-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (81 loc) · 2.78 KB
/
ci.yml
File metadata and controls
92 lines (81 loc) · 2.78 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
name: CI
on:
push:
branches: [master, refactoring]
pull_request:
branches: [master]
# Cancel an in-flight run for a branch when a new commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install ruff
run: pip install ruff
- name: ruff check
run: ruff check .
test:
name: pytest (Python ${{ matrix.python-version }})
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install eddy
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
# The pytest smoke suite reuses FITS files that live in
# docs/tutorials/ but are gitignored. Cache them across runs so
# we only download once per matrix entry per cache key.
- name: Cache tutorial FITS fixtures
id: cache-fits
uses: actions/cache@v4
with:
path: docs/tutorials/*.fits
key: tutorial-fits-v1
- name: Download tutorial FITS fixtures
if: steps.cache-fits.outputs.cache-hit != 'true'
working-directory: docs/tutorials
run: |
set -euo pipefail
base="https://dataverse.harvard.edu/api/access/datafile"
curl -fsSL -o HD163296_CO_v0.fits \
"${base}/:persistentId?persistentId=doi:10.7910/DVN/C2ZUNO/AWCSZR"
curl -fsSL -o HD163296_CO_dv0.fits \
"${base}/:persistentId?persistentId=doi:10.7910/DVN/C2ZUNO/NGOW49"
curl -fsSL -o TWHya_CO_cube.fits \
"${base}/:persistentId?persistentId=doi:10.7910/DVN/PXDKBC/QULHRK"
curl -fsSL -o TWHya_CO_cube_v0.fits \
"${base}/:persistentId?persistentId=doi:10.7910/DVN/KXELJL/VPLAM7"
- name: Verify fixtures present
working-directory: docs/tutorials
run: |
set -euo pipefail
for f in HD163296_CO_v0.fits HD163296_CO_dv0.fits \
TWHya_CO_cube.fits TWHya_CO_cube_v0.fits; do
test -s "$f" || { echo "missing fixture: $f"; exit 1; }
done
ls -lh *.fits
- name: Run pytest
env:
# Force JAX onto CPU for deterministic CI; JIT compile noise
# otherwise dominates the per-test timing.
JAX_PLATFORMS: cpu
run: pytest -v --tb=short