Skip to content

Commit 4894003

Browse files
committed
Streamline GitHub action runs
Expected impact: - Website-only PR: 22 min → 2 min (website job only) - Svelte-only PR: 22 min → 3 min (svelte + e2e) - Rust-only PR: 22 min → 8 min (rust checks, no slow deps) - Full-stack PR: 22 min → 8 min (all fast jobs in parallel)
1 parent e07a882 commit 4894003

2 files changed

Lines changed: 102 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,53 @@ on:
99
- main
1010

1111
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+
1251
# ===========================================
1352
# Desktop app - Rust backend
1453
# ===========================================
1554
desktop-rust:
1655
name: Desktop (Rust)
1756
runs-on: ubuntu-latest
57+
needs: changes
58+
if: needs.changes.outputs.rust == 'true' || github.event_name == 'push'
1859

1960
steps:
2061
- name: Checkout code
@@ -49,18 +90,6 @@ jobs:
4990
- name: Run clippy
5091
run: ./scripts/check/check --check clippy --ci
5192

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-
6493
- name: Run Rust tests
6594
run: ./scripts/check/check --check rust-tests --ci
6695

@@ -70,6 +99,8 @@ jobs:
7099
desktop-svelte:
71100
name: Desktop (Svelte)
72101
runs-on: ubuntu-latest
102+
needs: changes
103+
if: needs.changes.outputs.svelte == 'true' || github.event_name == 'push'
73104

74105
steps:
75106
- name: Checkout code
@@ -116,6 +147,8 @@ jobs:
116147
desktop-e2e:
117148
name: Desktop (E2E)
118149
runs-on: ubuntu-latest
150+
needs: changes
151+
if: needs.changes.outputs.desktop == 'true' || github.event_name == 'push'
119152
timeout-minutes: 30
120153

121154
steps:
@@ -157,6 +190,8 @@ jobs:
157190
website:
158191
name: Website
159192
runs-on: ubuntu-latest
193+
needs: changes
194+
if: needs.changes.outputs.website == 'true' || github.event_name == 'push'
160195

161196
steps:
162197
- name: Checkout code
@@ -224,6 +259,8 @@ jobs:
224259
license-server:
225260
name: License server
226261
runs-on: ubuntu-latest
262+
needs: changes
263+
if: needs.changes.outputs.license-server == 'true' || github.event_name == 'push'
227264

228265
steps:
229266
- name: Checkout code

.github/workflows/slow-checks.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Slow checks
2+
3+
# Daily security and dependency checks
4+
# Runs at 4 AM CET (3 AM UTC) to catch newly disclosed vulnerabilities
5+
# GitHub automatically emails repo admins on failure
6+
on:
7+
schedule:
8+
- cron: '0 3 * * *' # 4 AM CET = 3 AM UTC
9+
workflow_dispatch: # Allow manual trigger
10+
11+
jobs:
12+
dependency-checks:
13+
name: Dependency checks
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Install mise
21+
uses: jdx/mise-action@v2
22+
23+
- name: Install tools with mise
24+
run: mise install
25+
26+
- name: Cache Cargo
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cargo/registry/cache
30+
key: ${{ runner.os }}-cargo-${{ hashFiles('apps/desktop/src-tauri/Cargo.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-cargo-
33+
34+
- name: Install Tauri dependencies (Linux)
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
38+
39+
- name: Build check tool
40+
run: go build -o check .
41+
working-directory: ./scripts/check
42+
43+
- name: Run cargo-audit
44+
run: ./scripts/check/check --check cargo-audit --ci
45+
46+
- name: Run cargo-deny
47+
run: ./scripts/check/check --check cargo-deny --ci
48+
49+
- name: Install nightly toolchain (for cargo-udeps)
50+
run: rustup toolchain install nightly
51+
52+
- name: Run cargo-udeps
53+
run: ./scripts/check/check --check cargo-udeps --ci

0 commit comments

Comments
 (0)