-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (51 loc) · 1.55 KB
/
tests.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
name: "Tests"
on:
pull_request:
push:
branches:
- main
jobs:
self-test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
nom: [ "", "--no-nom"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
accept-flake-config = true
- name: Self-test
run: nix shell --inputs-from . nixpkgs#coreutils -c timeout --verbose 600 nix run . -- ${{ matrix.nom }}
- name: Self-test (should fail)
run: |
if nix shell --inputs-from . nixpkgs#coreutils -c timeout --verbose 600 nix run . -- --flake .#legacyPackages ${{ matrix.nom }}; then
echo "expect this to fail"
false
fi
tests:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
accept-flake-config = true
- name: Install nix-eval-jobs for remote test
run: nix profile install --inputs-from . nixpkgs#nix-eval-jobs
- run: command -v nix-eval-jobs && nix-eval-jobs --help
- name: Run tests
run: nix develop -c pytest ./tests