Skip to content

Commit 2c9346b

Browse files
Merge pull request #213 from loss-and-quick/ci/nightly-module-nix
ci: use Nix devshell for module builds and desktop-linux smoke
2 parents 89dcb91 + 6ccbb32 commit 2c9346b

3 files changed

Lines changed: 43 additions & 122 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -244,38 +244,30 @@ jobs:
244244
with:
245245
fetch-depth: 0
246246

247-
- name: Setup Rust
248-
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
247+
- name: Install Nix
248+
uses: DeterminateSystems/nix-installer-action@da36cb69b1c3247ad7a1f931ebfd954a1105ef14 # v14
249249
with:
250-
toolchain: stable
251-
targets: x86_64-unknown-linux-gnu
252-
253-
- name: Linux desktop deps
254-
run: |
255-
sudo apt-get update
256-
sudo apt-get install -y \
257-
libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev \
258-
libayatana-appindicator3-dev patchelf
250+
extra-conf: |
251+
accept-flake-config = true
259252
260-
- name: Setup Bun
261-
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
253+
- name: Cachix
254+
uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
262255
with:
263-
bun-version: latest
264-
265-
- name: Build the UI (generate_context embeds frontendDist)
266-
run: |
267-
bun install --frozen-lockfile
268-
( cd frontend && bun run build )
256+
name: kasumi-proxy
257+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
269258

270259
- name: Stub the libcronet bundle resource (compile-smoke doesn't bundle)
271260
run: |
272-
# tauri-build validates tauri.linux.conf.json's libcronet.so resource at
273-
# compile time; the real lib is fetched only for the bundle. Placeholder.
274261
mkdir -p src-tauri/binaries
275262
: > src-tauri/binaries/libcronet.so
276263
277264
- name: Compile the Tauri app (no bundle)
278-
run: cargo build -p kasumi-desktop
265+
run: |
266+
nix develop --command bash -euo pipefail -c '
267+
bun install --frozen-lockfile
268+
( cd frontend && bun run build )
269+
cargo build -p kasumi-desktop
270+
'
279271
280272
# ── Windows desktop compile smoke. Mirrors desktop-linux: the `rust` job runs on
281273
# Linux and never compiles the #[cfg(windows)] Platform + Win32 code, so this is

.github/workflows/nightly.yml

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -80,66 +80,29 @@ jobs:
8080
with:
8181
fetch-depth: 0
8282

83-
- name: Setup Bun
84-
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
85-
with:
86-
bun-version: latest
87-
88-
- name: Cache Bun dependencies
89-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
90-
with:
91-
path: ~/.bun/install/cache
92-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
93-
restore-keys: bun-${{ runner.os }}-
94-
95-
- name: Setup Rust (android targets)
96-
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
97-
with:
98-
toolchain: stable
99-
targets: aarch64-linux-android,x86_64-linux-android
100-
101-
- name: Install cargo-ndk
102-
uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2
103-
with:
104-
tool: cargo-ndk
105-
106-
- name: Setup Go
107-
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
83+
- name: Install Nix
84+
uses: DeterminateSystems/nix-installer-action@da36cb69b1c3247ad7a1f931ebfd954a1105ef14 # v14
10885
with:
109-
go-version: '1.26'
110-
cache: false
86+
extra-conf: |
87+
accept-flake-config = true
11188
112-
- name: Cache Go build & modules
113-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
89+
- name: Cachix
90+
uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
11491
with:
115-
path: |
116-
~/.cache/go-build
117-
~/go/pkg/mod
118-
key: go-${{ runner.os }}-geodat2srs
119-
restore-keys: go-${{ runner.os }}-
92+
name: kasumi-proxy
93+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
12094

121-
- name: Setup NDK
122-
id: setup-ndk
123-
uses: nttld/setup-ndk@ed92fe6cadad69be94a966a7ee3271275e62f779 # v1
124-
with:
125-
ndk-version: r28
126-
127-
- name: Install UI dependencies
128-
# bun workspace rooted at the repo — install from root against the single bun.lock.
129-
run: bun install --frozen-lockfile
130-
131-
- name: Lint & test
95+
- name: Install, lint & test
13296
run: |
133-
bunx biome check
134-
bun run frontend/scripts/check-i18n.ts
135-
( cd frontend && bunx vitest run )
97+
nix develop .#android --command bash -euo pipefail -c '
98+
bun install --frozen-lockfile
99+
bunx biome check
100+
bun run frontend/scripts/check-i18n.ts
101+
( cd frontend && bunx vitest run )
102+
'
136103
137104
- name: Build debug zip
138-
env:
139-
NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
140-
# package-release.sh names the zip itself (artifact-name.sh); the run's
141-
# commit is carried by the upload artifact name below.
142-
run: scripts/package-release.sh
105+
run: nix develop .#android --command bash -euo pipefail -c 'scripts/package-release.sh'
143106

144107
- name: Upload artifact
145108
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -261,58 +261,24 @@ jobs:
261261
ref: ${{ needs.prepare.outputs.version }}
262262
fetch-depth: 0
263263

264-
- name: Setup Bun
265-
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
266-
with:
267-
bun-version: latest
268-
269-
- name: Cache Bun dependencies
270-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
271-
with:
272-
path: ~/.bun/install/cache
273-
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
274-
restore-keys: bun-${{ runner.os }}-
275-
276-
- name: Setup Rust (android targets)
277-
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
278-
with:
279-
toolchain: stable
280-
targets: aarch64-linux-android,x86_64-linux-android
281-
282-
- name: Install cargo-ndk
283-
uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2
284-
with:
285-
tool: cargo-ndk
286-
287-
- name: Setup Go
288-
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
264+
- name: Install Nix
265+
uses: DeterminateSystems/nix-installer-action@da36cb69b1c3247ad7a1f931ebfd954a1105ef14 # v14
289266
with:
290-
go-version: '1.26'
291-
cache: false
267+
extra-conf: |
268+
accept-flake-config = true
292269
293-
- name: Cache Go build & modules
294-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
295-
with:
296-
path: |
297-
~/.cache/go-build
298-
~/go/pkg/mod
299-
key: go-${{ runner.os }}-geodat2srs
300-
restore-keys: go-${{ runner.os }}-
301-
302-
- name: Setup NDK
303-
id: setup-ndk
304-
uses: nttld/setup-ndk@ed92fe6cadad69be94a966a7ee3271275e62f779 # v1
270+
- name: Cachix
271+
uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
305272
with:
306-
# Mirror flake.nix NDK 28.0.13004108 (== r28).
307-
ndk-version: r28
308-
309-
- name: Install UI dependencies
310-
run: bun install --frozen-lockfile
273+
name: kasumi-proxy
274+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
311275

312276
- name: Build release zip
313-
env:
314-
NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
315-
run: scripts/package-release.sh
277+
run: |
278+
nix develop .#android --command bash -euo pipefail -c '
279+
bun install --frozen-lockfile
280+
scripts/package-release.sh
281+
'
316282
317283
- name: Upload to the release
318284
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2

0 commit comments

Comments
 (0)