use nix in github action #62
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v22 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Build | |
working-directory: app/ | |
run: nix-shell --run "node --version && cargo build" | |
- name: Run tests | |
working-directory: app/ | |
run: nix-shell --run "cargo test" | |
- name: Npm install | |
working-directory: app/ | |
run: nix-shell --run "npm ci" | |
- name: Install playwright deps and run tests | |
working-directory: app/ | |
run: nix-shell --run "node --version && npx playwright install --with-deps && npx playwright test" |