|
9 | 9 | - main |
10 | 10 |
|
11 | 11 | jobs: |
| 12 | + # =========================================== |
| 13 | + # Determine which jobs to run based on changed files |
| 14 | + # =========================================== |
| 15 | + changes: |
| 16 | + name: Detect changes |
| 17 | + runs-on: ubuntu-latest |
| 18 | + outputs: |
| 19 | + rust: ${{ steps.filter.outputs.rust }} |
| 20 | + svelte: ${{ steps.filter.outputs.svelte }} |
| 21 | + desktop: ${{ steps.filter.outputs.desktop }} |
| 22 | + website: ${{ steps.filter.outputs.website }} |
| 23 | + license-server: ${{ steps.filter.outputs.license-server }} |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Detect file changes |
| 29 | + uses: dorny/paths-filter@v3 |
| 30 | + id: filter |
| 31 | + with: |
| 32 | + filters: | |
| 33 | + rust: |
| 34 | + - 'apps/desktop/src-tauri/**' |
| 35 | + svelte: |
| 36 | + - 'apps/desktop/src/**' |
| 37 | + - 'apps/desktop/static/**' |
| 38 | + - 'apps/desktop/package.json' |
| 39 | + - 'apps/desktop/pnpm-lock.yaml' |
| 40 | + - 'apps/desktop/svelte.config.js' |
| 41 | + - 'apps/desktop/vite.config.ts' |
| 42 | + - 'apps/desktop/tsconfig.json' |
| 43 | + - 'apps/desktop/tailwind.config.ts' |
| 44 | + desktop: |
| 45 | + - 'apps/desktop/**' |
| 46 | + website: |
| 47 | + - 'apps/website/**' |
| 48 | + license-server: |
| 49 | + - 'apps/license-server/**' |
| 50 | +
|
12 | 51 | # =========================================== |
13 | 52 | # Desktop app - Rust backend |
14 | 53 | # =========================================== |
15 | 54 | desktop-rust: |
16 | 55 | name: Desktop (Rust) |
17 | 56 | runs-on: ubuntu-latest |
| 57 | + needs: changes |
| 58 | + if: needs.changes.outputs.rust == 'true' || github.event_name == 'push' |
18 | 59 |
|
19 | 60 | steps: |
20 | 61 | - name: Checkout code |
|
49 | 90 | - name: Run clippy |
50 | 91 | run: ./scripts/check/check --check clippy --ci |
51 | 92 |
|
52 | | - - name: Run cargo-audit |
53 | | - run: ./scripts/check/check --check cargo-audit --ci |
54 | | - |
55 | | - - name: Run cargo-deny |
56 | | - run: ./scripts/check/check --check cargo-deny --ci |
57 | | - |
58 | | - - name: Install nightly toolchain (for cargo-udeps) |
59 | | - run: rustup toolchain install nightly |
60 | | - |
61 | | - - name: Run cargo-udeps |
62 | | - run: ./scripts/check/check --check cargo-udeps --ci |
63 | | - |
64 | 93 | - name: Run Rust tests |
65 | 94 | run: ./scripts/check/check --check rust-tests --ci |
66 | 95 |
|
|
70 | 99 | desktop-svelte: |
71 | 100 | name: Desktop (Svelte) |
72 | 101 | runs-on: ubuntu-latest |
| 102 | + needs: changes |
| 103 | + if: needs.changes.outputs.svelte == 'true' || github.event_name == 'push' |
73 | 104 |
|
74 | 105 | steps: |
75 | 106 | - name: Checkout code |
@@ -116,6 +147,8 @@ jobs: |
116 | 147 | desktop-e2e: |
117 | 148 | name: Desktop (E2E) |
118 | 149 | runs-on: ubuntu-latest |
| 150 | + needs: changes |
| 151 | + if: needs.changes.outputs.desktop == 'true' || github.event_name == 'push' |
119 | 152 | timeout-minutes: 30 |
120 | 153 |
|
121 | 154 | steps: |
@@ -157,6 +190,8 @@ jobs: |
157 | 190 | website: |
158 | 191 | name: Website |
159 | 192 | runs-on: ubuntu-latest |
| 193 | + needs: changes |
| 194 | + if: needs.changes.outputs.website == 'true' || github.event_name == 'push' |
160 | 195 |
|
161 | 196 | steps: |
162 | 197 | - name: Checkout code |
@@ -224,6 +259,8 @@ jobs: |
224 | 259 | license-server: |
225 | 260 | name: License server |
226 | 261 | runs-on: ubuntu-latest |
| 262 | + needs: changes |
| 263 | + if: needs.changes.outputs.license-server == 'true' || github.event_name == 'push' |
227 | 264 |
|
228 | 265 | steps: |
229 | 266 | - name: Checkout code |
|
0 commit comments