37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
# https://devenv.sh/integrations/github-actions
|
|
# https://forgejo.org/docs/latest/user/actions/
|
|
name: Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: apt-get update && apt-get install sudo
|
|
- uses: actions/setup-node@v4
|
|
- uses: actions/checkout@v4
|
|
- uses: cachix/install-nix-action@v31
|
|
with:
|
|
extra_nix_config: | # https://github.com/NixOS/nix/issues/11295
|
|
sandbox = false
|
|
- run: nix --option sandbox false profile install nixpkgs#devenv
|
|
- uses: rharkor/caching-for-turbo@v1.8
|
|
- name: Run tests
|
|
run: |
|
|
# https://stackoverflow.com/a/78185023/12979111
|
|
export HOME=$(mktemp -d)
|
|
|
|
# https://github.com/NixOS/nix/issues/670#issuecomment-304524165
|
|
export NIX_STORE_DIR=$HOME/nix/store
|
|
export NIX_STATE_DIR=$HOME/nix/var/nix
|
|
export NIX_LOG_DIR=$HOME/nix/var/log/nix
|
|
|
|
devenv shell pnpm install
|
|
devenv shell pnpm lint
|
|
devenv shell pnpm build
|
|
devenv shell pnpm test:unit
|
|
devenv shell pnpm test:e2e
|