-
Notifications
You must be signed in to change notification settings - Fork 1
160 lines (140 loc) Β· 6.05 KB
/
Copy pathci.yml
File metadata and controls
160 lines (140 loc) Β· 6.05 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# Cancel in-progress runs for the same PR or branch when a new commit lands.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- id: filter
# Detect whether the current change touches anything that can affect
# the Rust build. Locale-only / docs-only PRs skip the Rust matrix
# entirely to save Actions minutes (the windows matrix slot is 2Γ per
# minute). The workflow file itself is part of the filter so CI tweaks
# still re-run the job.
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
with:
filters: |
rust:
- 'src-tauri/**'
- '.github/workflows/ci.yml'
rust:
name: Rust (${{ matrix.os }})
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- name: Cache APT packages
if: runner.os == 'Linux'
# Tauri 2 on Linux still uses GTK 3 + WebKitGTK; cpal needs ALSA
# development headers; the rest mirrors what `cargo check` will
# link against transitively from the Tauri runtime.
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: >-
libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev
libayatana-appindicator3-dev librsvg2-dev libasound2-dev
libssl-dev pkg-config
version: v1
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: src-tauri
- name: cargo check
run: cargo check --manifest-path src-tauri/Cargo.toml --workspace --all-targets
- name: cargo check (waveflow-core, server profile β no plugin host)
# Locks in the slim build path the future `waveflow-server` consumes:
# `default-features = false, features = ["postgres"]`. Without this
# step a future dep added unconditionally to `waveflow-core` (or a
# missing `optional = true` on a plugin-only crate) would silently
# re-introduce the wasmtime + Cranelift transitive tree the server's
# binary doesn't want. The desktop matrix slot above still exercises
# the full feature set under `--workspace --all-targets`.
if: runner.os == 'Linux'
run: >-
cargo check
--manifest-path src-tauri/Cargo.toml
-p waveflow-core
--no-default-features
--features postgres
- name: cargo test (full workspace)
if: runner.os == 'Linux'
run: cargo test --manifest-path src-tauri/Cargo.toml --workspace
- name: cargo test (Windows β exclude the Tauri app crate)
# The `waveflow` app-crate test binary links the Tauri / WebView2
# runtime and fails to START headless on windows-latest with
# STATUS_ENTRYPOINT_NOT_FOUND (exit 0xc0000139) β the loader
# can't resolve the webview DLL's imports next to a bare test
# exe. Its unit tests are pure logic and already run on Linux
# above; the portable crates (`waveflow-core`, β¦) still run here,
# and `cargo check --all-targets` above already exercises the app
# crate's Windows compilation. So skip only the app crate's test
# binary on Windows rather than losing the whole Windows matrix
# slot.
if: runner.os == 'Windows'
run: cargo test --manifest-path src-tauri/Cargo.toml --workspace --exclude waveflow
- name: cargo test (waveflow-core, sqlite backend)
# `sqlite` is NOT a default feature of waveflow-core, so the
# module tree behind it β including the scanner passes that talk
# to SQLite and their tests β only compiles when something in the
# build graph turns it on. The Linux `--workspace` run gets that
# for free via feature unification with the app crate, but the
# Windows run excludes exactly that crate, so those tests would
# silently not exist there. Ask for the feature explicitly rather
# than relying on unification, on both runners.
run: >
cargo test
--manifest-path src-tauri/Cargo.toml
-p waveflow-core
--features sqlite
frontend:
name: Frontend
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
# Resolving `bun-version: latest` hits the GitHub API to list
# `oven-sh/bun` tags. The action reads GITHUB_TOKEN from env to
# authenticate; without it the request returns 401 ("Bad
# credentials") on GitHub-hosted runners. The action has no
# `github-token` input, so we plumb the token through env.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- name: bun install
run: bun install --frozen-lockfile
- name: ESLint
run: bun run lint
- name: TypeScript
run: bun run typecheck
- name: Vite production build
run: bun run build