-
Notifications
You must be signed in to change notification settings - Fork 171
152 lines (149 loc) · 5.09 KB
/
ci.yml
File metadata and controls
152 lines (149 loc) · 5.09 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: ci
on:
push:
branches:
- "main"
- "test-me/*"
pull_request:
schedule:
- cron: "0 7 * * 1" # Run every Monday at 7:00 UTC
concurrency:
group: branch-${{ github.head_ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -el {0}
jobs:
cache-pixi-lock:
uses: ./.github/workflows/cache-pixi-lock.yml
unit-test:
name: "Unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests"
runs-on: ${{ matrix.os }}-latest
needs: [cache-pixi-lock]
env:
COVERAGE_REPORT: "${{ matrix.os }}_${{ matrix.pixi-environment }}_unit_test_report.html"
strategy:
fail-fast: false
matrix:
os: [ubuntu, mac, windows]
pixi-environment: [test-latest]
include:
- os: ubuntu
pixi-environment: "test-py311"
- os: ubuntu
pixi-environment: "test-py313"
- os: ubuntu
pixi-environment: "test-minimum"
steps:
- uses: actions/checkout@v5
- name: Restore cached pixi lockfile
uses: actions/cache/restore@v4
id: restore-pixi-lock
with:
enableCrossOsArchive: true
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.0
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
- name: Unit test
run: |
pixi run -e ${{ matrix.pixi-environment }} tests -v -s --cov=parcels --cov-report=xml --html="${{ env.COVERAGE_REPORT }}" --self-contained-html
- name: Codecov
uses: codecov/codecov-action@v5.5.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unit-tests
- name: Upload test results
if: ${{ always() }} # Always run this step, even if tests fail
uses: actions/upload-artifact@v5
with:
name: Unittest report ${{ matrix.os }}-${{ matrix.pixi-environment }}
path: ${{ env.COVERAGE_REPORT }}
integration-test:
name: "Integration: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests-notebooks"
runs-on: ${{ matrix.os }}-latest
needs: [cache-pixi-lock]
env:
COVERAGE_REPORT: "${{ matrix.os }}_${{ matrix.pixi-environment }}_integration_test_report.html"
strategy:
fail-fast: false
matrix:
os: [ubuntu] #, mac, windows] # TODO v4: Re-enable windows and mac
pixi-environment: ["test-notebooks-latest"]
include:
- os: ubuntu
pixi-environment: test-notebooks-py311
steps:
- uses: actions/checkout@v5
- name: Restore cached pixi lockfile
uses: actions/cache/restore@v4
id: restore-pixi-lock
with:
enableCrossOsArchive: true
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.0
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
- name: Integration test
run: |
pixi run -e ${{matrix.pixi-environment}} tests-notebooks -v -s --html="${{ env.COVERAGE_REPORT }}" --self-contained-html --cov=parcels --cov-report=xml
- name: Codecov
uses: codecov/codecov-action@v5.5.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: integration-tests
- name: Upload test results
if: ${{ always() }} # Always run this step, even if tests fail
uses: actions/upload-artifact@v5
with:
name: Integration test report ${{ matrix.os }}-${{ matrix.pixi-environment }}
path: ${{ env.COVERAGE_REPORT }}
merge-test-artifacts:
runs-on: ubuntu-latest
needs:
- unit-test
- integration-test
- typechecking
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v5
with:
name: Testing reports
pattern: "* report *"
typechecking:
name: "TypeChecking: pixi run typing"
# TODO v4: Enable typechecking again
if: false
runs-on: ubuntu-latest
needs: [cache-pixi-lock]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Restore cached pixi lockfile
uses: actions/cache/restore@v4
id: restore-pixi-lock
with:
path: |
pixi.lock
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
- uses: prefix-dev/setup-pixi@v0.9.0
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
- name: Typechecking
run: |
pixi run typing --non-interactive --html-report mypy-report
- name: Upload test results
if: ${{ always() }} # Upload even on mypy error
uses: actions/upload-artifact@v5
with:
name: Mypy report
path: mypy-report