Skip to content

Commit d5af5ce

Browse files
committed
Update GitHub Actions
We update things to be a bit more modern: - We rename the file to not be about `nodejs` (because it never really was, that was an implementation detail). - We trigger on all `pull_request_target` events. - We trigger on pushes to the `main` or `joneshf/<something>` branches. - We rename the job from `build` to `test` (because that's what we're actually doing: testing). - We bump the version of `actions/checkout`. - We switch to using `cachix/install-nix-action`. It would be nice to have this stuff cached somewhere, but caching with GitHub Actions plus Nix plus Node.js takes more than a modicum of effort, so we're not going to deal with it.
1 parent 76a910f commit d5af5ce

File tree

2 files changed

+53
-16
lines changed

2 files changed

+53
-16
lines changed

.github/workflows/nodejs.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
11+
- name: Install Nix
12+
uses: nixbuild/nix-quick-install-action@63ca48f939ee3b8d835f4126562537df0fee5b91
13+
- name: Cache Nix store
14+
uses: nix-community/cache-nix-action@135667ec418502fa5a3598af6fb9eb733888ce6a
15+
with:
16+
# The key includes the os/arch pair since artifacts in the Nix store are platform-specific.
17+
primary-key: nix-${{ join([runner.os, runner.arch], "_") }}-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}
18+
restore-prefixes-first-match: |
19+
nix-${{ join([runner.os, runner.arch], "_") }}-${{ hashFiles('flake.lock') }}-
20+
nix-${{ join([runner.os, runner.arch], "_") }}-
21+
- name: Cache node_modules
22+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
23+
with:
24+
# The key includes the os/arch pair since artifacts in `node_modules` can be platform-specific.
25+
key: node_modules-${{ join([runner.os, runner.arch], "_") }}-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}
26+
path: "**/node_modules"
27+
restore-keys: |
28+
node_modules-${{ join([runner.os, runner.arch], "_") }}-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-
29+
node_modules-${{ join([runner.os, runner.arch], "_") }}-${{ hashFiles('flake.lock') }}-
30+
node_modules-${{ join([runner.os, runner.arch], "_") }}-
31+
- name: Cache bower_components
32+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
33+
with:
34+
key: bower_components-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('bower.json') }}
35+
path: bower_components
36+
restore-keys: |
37+
bower_components-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}-
38+
bower_components-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-
39+
bower_components-${{ hashFiles('flake.lock') }}-
40+
bower_components-
41+
- name: Cache output
42+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
43+
with:
44+
key: output-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('bower.json') }}-${{ hashFiles('**/*.js', '**/*.purs') }}
45+
path: output
46+
restore-keys: |
47+
output-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('bower.json') }}-
48+
output-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-${{ hashFiles('**/package-lock.json') }}-
49+
output-${{ hashFiles('flake.lock') }}-${{ hashFiles('**/*.nix') }}-
50+
output-${{ hashFiles('flake.lock') }}-
51+
output-
52+
- name: Test
53+
run: nix develop . --command make test

0 commit comments

Comments
 (0)