Skip to content

Commit eeee8cd

Browse files
committed
ci: build and test through Bazel
Replaces the per-subproject install and build steps with 'bazel test //...' and 'bazel build //:site'. Bazel supplies the Node toolchain, npm dependencies and Playwright browsers, so there is no setup-node, package-manager install or playwright install step -- which was the point of the migration. The tests now run on pull requests; previously they ran nowhere. setup-bazel's caches all default to false, so they are enabled explicitly. The upload and gh-pages deploy jobs are unchanged. Only the way out/ is produced changes: bazel-bin is a symlink the artifact upload does not follow, so the tree is staged with cp -RL. Bazel's outputs are mode 555 and the deploy job commits this tree, so modes are normalised to 644/755 -- without that every deployed file would flip to executable and the first deploy would diff the whole tree. Verified by running the exact sequence locally: the staged artifact is 38 files, byte-identical to the pre-migration CI output, with file modes matching too.
1 parent 67e6cf7 commit eeee8cd

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

.github/workflows/actions.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- run: mkdir -p out
14-
- run: cp src/index.html out/
15-
- run: cp -r src/audio-tuning src/mic-testing src/volume-tuning src/pwa-audio-recorder src/screen-capture-test out/
16-
- run: corepack enable && pnpm install --frozen-lockfile && pnpm run build
17-
working-directory: src/ds-playground
18-
- run: cp -r src/ds-playground/dist out/ds-playground
19-
- name: Build AECDump Viewer
20-
run: corepack enable && pnpm install --frozen-lockfile && pnpm run build
21-
working-directory: src/aecdump-viewer
22-
- name: Copy AECDump Viewer to out
23-
run: cp -r src/aecdump-viewer/dist out/aecdump-viewer
13+
# Bazel provides the Node toolchain, npm dependencies and browsers, so no
14+
# setup-node, package-manager install or playwright install step is needed.
15+
# All four caches default to false and must be enabled explicitly.
16+
- uses: bazel-contrib/setup-bazel@0.19.0
17+
with:
18+
bazelisk-cache: true
19+
disk-cache: ${{ github.workflow }}
20+
repository-cache: true
21+
- name: Test
22+
run: bazel test //...
23+
- name: Build site
24+
run: bazel build //:site
25+
# bazel-bin is a symlink into the output base, and the artifact upload does
26+
# not follow it, so stage the tree. Bazel's outputs are mode 555; the deploy
27+
# job commits this tree to gh-pages, so normalise to 644/755 or every file
28+
# would land marked executable.
29+
- name: Stage site
30+
run: |
31+
mkdir -p out && cp -RL bazel-bin/site/. out/
32+
find out -type d -exec chmod 755 {} +
33+
find out -type f -exec chmod 644 {} +
2434
- uses: actions/upload-artifact@v4
2535
with:
2636
name: out

0 commit comments

Comments
 (0)