Skip to content
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Test"

on:
pull_request:
push:

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

# Use exact commit IDs instead of versions as recommended by Github
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- uses: cachix/install-nix-action@4eae8bea4afaa8f8ea8aa638ab9a7fead2f3d21e # v31
- uses: cachix/cachix-action@97e5ff84d02b3b4f9936339f767e17f03c9252ed # v16
Comment thread
dastarruer marked this conversation as resolved.
with:
name: devenv
- name: Install devenv.sh
run: nix profile add nixpkgs#devenv
Comment thread
dastarruer marked this conversation as resolved.

# Required for the npm-format hook
- name: Install npm dependencies
# Run inside the devenv shell to use the correct node version
run: devenv shell -- bash -c 'cd app && npm install'

- name: Build the devenv shell and run any pre-commit hooks
run: devenv test
6 changes: 5 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
fi

cd "${config.git.root}/app"
npm run format
npx prettier --write .
'';
};
in {
Expand Down Expand Up @@ -82,4 +82,8 @@ in {
cwd = "${config.git.root}/app";
};
};

enterTest = ''
node --version | grep -Fx "v${pkgs.nodejs_latest.version}"
'';
Comment thread
dastarruer marked this conversation as resolved.
}
Loading