-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.28 KB
/
tests.yml
File metadata and controls
85 lines (73 loc) · 2.28 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
name: Test workflow
permissions:
contents: read
checks: write
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
backend: [numpy, pytorch, jax]
python-version: ["3.11", "3.12", "3.13", "3.14"]
permissions:
checks: write
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install system build dependencies (when binary not available)
run: |
sudo apt-get update
sudo apt-get install -y \
gfortran pkg-config ninja-build \
libopenblas-dev liblapack-dev \
libfftw3-dev libhealpix-cxx-dev
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry env use python
poetry install --extras "healpy_support"
- name: Install pytorch specific dependencies afterward
if: ${{ matrix.backend == 'pytorch' }}
run: |
poetry install --extras "healpy_support" --extras "pytorch_support"
- name: Run tests
run: |
export PYRECEST_BACKEND=${{ matrix.backend }}
poetry run python -m pytest --rootdir . -v --strict-config --junitxml=junit_test_results_${{ matrix.backend }}.xml ./pyrecest
env:
PYTHONPATH: ${{ github.workspace }}
- name: Upload test result artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.backend }}-${{ matrix.python-version }}-test-results
path: junit_test_results_${{ matrix.backend }}.xml
publish-results:
needs: test
runs-on: ubuntu-latest
if: always()
permissions:
checks: write
pull-requests: write
steps:
- name: Download all test result artifacts
uses: actions/download-artifact@v4
with:
path: test-results
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
test-results/*/junit_test_results_*.xml