-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (84 loc) · 2.68 KB
/
test.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Test
on:
push:
branches: [ master ]
paths:
- test/*
- src/fiat/*
- .testdata/*
- pyproject.toml
- .github/workflows/test.yml
pull_request:
branches: [ master ]
paths:
- test/*
- src/fiat/*
- .testdata/*
- pyproject.toml
- .github/workflows/test.yml
jobs:
Test:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- os: ubuntu-latest
label: linux-64
prefix: /home/runner/miniconda3/envs/fiat_test
name: ${{ matrix.label }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.python-version }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check-out source
uses: actions/checkout@v4
- name: Generate env yaml
run: pip install tomli && python make_env.py test -p ${{ matrix.python-version }}.*
- name: load from cache
id: cache
uses: actions/cache/restore@v4
with:
path: |
/home/runner/miniconda3
~/pycache
# the below two settings mean we'll alway srestore the cache
# but the cache hit output can tell us if we have to update afterwards
key: test-py${{ matrix.python-version }}-${{ hashFiles('environment.yml') }}
restore-keys: |
test-py${{ matrix.python-version }}
- name: Fail on no cache restore
if: steps.cache.outputs.cache-matched-key == ''
run: |
echo "Failed to restore any cache. exiting..."
exit 1
- name: Update environment
if: steps.cache.outputs.cache-hit != 'true'
run: |
export PATH=/home/runner/miniconda3/bin:$PATH
mamba env update -n fiat_test -f environment.yml
- name: Conda info
run: |
export PATH=/home/runner/miniconda3/bin:$PATH
conda info
conda list -n fiat_test
- name: Create testdata
run: |
export PATH=/home/runner/miniconda3/bin:$PATH
mamba run -n fiat_test python .testdata/create_test_data.py
- name: Test
run: |
export PATH=/home/runner/miniconda3/bin:$PATH
mamba run -n fiat_test python -m pytest --verbose --cov=fiat --cov-report xml
- name: Upload coverage to codecov.io
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true