-
Notifications
You must be signed in to change notification settings - Fork 91
56 lines (48 loc) · 1.71 KB
/
checks.yml
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
name: Checks
on:
pull_request:
push:
branches:
- main
jobs:
spellcheck:
name: Check Spelling
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- run: npm install -g cspell
- run: cd javascript && cspell .
check-nix-hash:
name: "Check nix hash is up-to-date"
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.PUSH_COMMIT_APP_ID }}
private-key: ${{ secrets.PUSH_COMMIT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: cachix/install-nix-action@v24
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: "Building the nix file"
run: |
echo "If the job is failing with: \"hash mismatch in fixed-output derivation\""
echo "Copy the hash after \"got:\" and replace \"npmDepsHash\" in \"flake-module.nix\" with the hash"
! nix develop --command "exit 1" 2>shell_output
# Filter the hash and then replace it in `flake-module.nix`
# This needs to run before the last step that may let's the job fail
cat shell_output | grep "got:" | sed "s/[ \t]*got:[ \t]*//" > hash
sed "s@npmDepsHash = \"[^\"]*\"@npmDepsHash = \"$(cat hash)\"@" -i flake-module.nix
! cat shell_output | grep "hash mismatch" -A2
- uses: stefanzweifel/git-auto-commit-action@v5
if: failure()
with:
add_options: '-u'
commit_message: Fix nix hash