-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (116 loc) · 4.24 KB
/
test-on-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Test Build (PRs)
permissions: read-all
on:
pull_request:
env:
CARGO_TERM_COLOR: always
# sccache enablement
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
# Cancel the build if a new commit is pushed to the branch as a PR.
# Allow each PR to have its own build.
concurrency:
group: rust-${{ github.ref }}-${{ github.head_ref}}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Install bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
- name: Create Fake .env File (dotenvy_macro requirement)
run: |
touch src-tauri/.env
echo APTABASE_KEY=${{ secrets.APTABASE_KEY }} >> src-tauri/.env
- name: Install Dependencies
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
sudo apt-get install --no-install-recommends javascriptcoregtk-4.1 \
libsoup-3.0 \
webkit2gtk-4.1
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5
- name: Rust setup
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # master
with:
toolchain: stable
- name: Install Client Dependencies & Build
run: |
bun install
bun run build
- name: Build the Tauri App
run: bunx tauri build
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }}
- name: Show sccache stats
shell: bash
run: |
echo '## SCCACHE STATS' >> $GITHUB_STEP_SUMMARY
echo '| Metric | Value |' >> $GITHUB_STEP_SUMMARY
echo '|--------|-------|' >> $GITHUB_STEP_SUMMARY
${SCCACHE_PATH} --show-stats | awk -F'[[:space:]][[:space:]]+' 'NR<=22{ print "| "$1" | "$2" |"}' >> $GITHUB_STEP_SUMMARY
echo '</hr>' >> $GITHUB_STEP_SUMMARY
clippy:
name: Clippy Check
timeout-minutes: 30
runs-on: ubuntu-latest
needs: build
steps:
- uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Install bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
- name: Install Dependencies
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
sudo apt-get install --no-install-recommends javascriptcoregtk-4.1 \
libsoup-3.0 \
webkit2gtk-4.1
- name: Create .env
run: |
touch src-tauri/.env
echo APTABASE_KEY=${{ secrets.APTABASE_KEY }} >> src-tauri/.env
- name: Install Client Dependencies & Build
run: |
bun install
bun run build
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5
- name: Rust setup
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # master
with:
toolchain: stable
- name: Run clippy
run: |
cd src-tauri
cargo clippy -- -D warnings