-
Notifications
You must be signed in to change notification settings - Fork 154
40 lines (40 loc) · 1.43 KB
/
nix.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
---
name: Test Nix
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
name: fipy
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: nix-community
- run: echo "UID=${UID}" >> $GITHUB_ENV
- uses: actions/cache/restore@v3
with:
path: /run/user/${{ env.UID }}/http_cache.sqlite
key: ${{ runner.os }}-http_cache.sqlite
- run: |
nix develop --command bash -c "python -c 'import fipy; fipy.test()' > test.out 2>&1" || true
status=$?
# echo ::set-output name=errors::`cat test.out`
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "text<<$EOF" >> $GITHUB_STEP_SUMMARY
echo "FiPy messages: $(cat test.out)." >> $GITHUB_STEP_SUMMARY
echo "$EOF" >> $GITHUB_STEP_SUMMARY
exit $status
- run: nix develop --command bash -c "py.test --nbval --nbval-sanitize-with examples/sanitize.cfg examples/index.ipynb"
- uses: actions/cache/save@v3
if: always()
with:
path: /run/user/${{ env.UID }}/http_cache.sqlite
key: ${{ runner.os }}-http_cache.sqlite