1- name : Test workflows
1+ name : Test
22
33on :
44 push :
@@ -17,8 +17,30 @@ concurrency:
1717 cancel-in-progress : true
1818
1919jobs :
20- run-tests :
21- name : OS
20+ unit-tests :
21+ name : Unit
22+ runs-on : ubuntu-latest
23+
24+ defaults :
25+ run :
26+ shell : bash -l {0}
27+
28+ steps :
29+ - uses : actions/checkout@v6
30+
31+ - name : Setup Pixi
32+ uses : prefix-dev/setup-pixi@v0.9.4
33+ with :
34+ pixi-version : v0.59.0
35+ cache : true
36+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'master' }}
37+
38+ - name : Run unit tests
39+ run : |
40+ pixi run unit-tests
41+
42+ integration-tests :
43+ name : Integration
2244 runs-on : ${{ matrix.os }}-latest
2345 strategy :
2446 fail-fast : false
4365 - 'data/**'
4466 - 'Snakefile'
4567 - 'config/**'
46- - 'test/**'
4768 - 'pixi.toml'
4869 - 'pixi.lock'
4970 - '.github/workflows/test.yaml'
@@ -58,31 +79,41 @@ jobs:
5879 sudo docker builder prune -a --force
5980 echo "Final disk space"
6081 df -h
82+
6183 - name : Skip - no source changes
6284 if : steps.filter.outputs.src != 'true' && github.event_name != 'schedule'
6385 run : echo "Skipping tests because no source code changes detected"
6486
6587 - name : Setup Pixi
6688 if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
67- uses : prefix-dev/setup-pixi@v0.9.3
89+ uses : prefix-dev/setup-pixi@v0.9.4
6890 with :
6991 pixi-version : v0.59.0
7092 cache : true
71- # Do not cache in branches
72- cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
93+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'master' }}
7394
7495 - name : Setup cache keys
7596 if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
7697 run : |
77- echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV # data and cutouts
98+ echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV # data
99+ echo "MONTH=$(date +'%Y%m')" >> $GITHUB_ENV # cutouts
100+ echo "VERSIONS_HASH=${{ hashFiles('data/versions.csv') }}" >> $GITHUB_ENV
78101
79102 - uses : actions/cache@v5
80103 if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
81104 with :
82- path : |
83- data
84- cutouts
85- key : data-cutouts-${{ env.WEEK }}
105+ path : data
106+ key : data-${{ env.WEEK }}-${{ env.VERSIONS_HASH }}
107+
108+ - uses : actions/cache@v5
109+ if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
110+ with :
111+ path : cutouts
112+ key : cutouts-${{ env.MONTH }}
113+
114+ - name : Restore git-tracked files in data/
115+ if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
116+ run : git checkout HEAD -- data/
86117
87118 - name : Run pylint check on scripts
88119 if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
@@ -98,11 +129,6 @@ jobs:
98129 run : |
99130 pixi run integration-tests
100131
101- - name : Run unit tests
102- if : steps.filter.outputs.src == 'true' || github.event_name == 'schedule'
103- run : |
104- pixi run unit-tests
105-
106132 - name : Upload artifacts
107133 if : always()
108134 uses : actions/upload-artifact@v6
0 commit comments