-
Notifications
You must be signed in to change notification settings - Fork 56
143 lines (120 loc) · 4.13 KB
/
tests.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
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
name: Tests
on:
push:
branches:
- main
tags:
- '*'
pull_request:
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'docs only')
strategy:
fail-fast: true
matrix:
include:
- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: codestyle
- name: Python 3.10 with minimal dependencies and coverage
os: ubuntu-latest
python: '3.10'
toxenv: py310-test-cov
- name: Python 3.9
os: ubuntu-latest
python: '3.9'
toxenv: py39-test
- name: Python 3.10
os: ubuntu-latest
python: '3.10'
toxenv: py310-test
- name: Python 3.11
os: ubuntu-latest
python: '3.11'
toxenv: py311-test
# Has to happen on ubuntu because galpy is finnicky on macOS
- name: Python 3.10 with all optional dependencies
os: ubuntu-latest
python: '3.10'
toxenv: py310-test-extradeps
toxposargs: --durations=50
- name: Python 3.10 without GSL
os: ubuntu-latest
python: '3.10'
toxenv: nogsl
- name: Python 3.9 with oldest supported version of all dependencies
os: ubuntu-latest
python: 3.9
toxenv: py39-test-oldestdeps
# Mac and Windows:
- name: Python 3.10 standard tests (macOS)
os: macos-latest
python: '3.10'
toxenv: py310-test
# - name: Python 3.9 standard tests (Windows)
# os: windows-latest
# python: 3.9
# toxenv: py39-test
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# For animation tests
- uses: FedericoCarboni/setup-ffmpeg@v3
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}
id: setup-ffmpeg
- name: Set up Python ${{ matrix.python }} on ${{ matrix.os }}
if: ${{ !startsWith(matrix.os, 'windows') }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# Windows:
# - uses: conda-incubator/setup-miniconda@v2
# if: startsWith(matrix.os, 'windows')
# with:
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}
# - name: Install Python dependencies - Windows
# if: startsWith(matrix.os, 'windows')
# shell: bash -l {0}
# run: |
# conda install -c conda-forge -q gsl python=3.9 libpython
# python -m pip install -e .[test]
# python -m pip install tox
# - name: Run tests - Windows
# if: startsWith(matrix.os, 'windows')
# shell: bash -l {0}
# run: |
# tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} ${{ matrix.toxposargs }}
# Mac:
- name: Setup Mac - GSL
if: startsWith(matrix.os, 'mac')
run: |
brew install gsl
# Ubuntu:
- name: Setup Linux - GSL
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install gsl-bin libgsl0-dev build-essential
sudo apt-get install libhdf5-serial-dev # TODO: remove when h5py has 3.11 wheels
# Any *nix:
- name: Install Python dependencies - nix
if: ${{ !startsWith(matrix.os, 'windows') }}
run: python -m pip install --upgrade tox codecov
- name: Run tests - nix
if: ${{ !startsWith(matrix.os, 'windows') }}
run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
# Coverage:
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v4
if: steps.check_files.outputs.files_exists == 'true' && runner.os == 'Linux'
with:
file: ./coverage.xml # optional