-
Notifications
You must be signed in to change notification settings - Fork 36
92 lines (89 loc) · 2.92 KB
/
run-pytest.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
name: Run Unit Tests
on:
# trigger on pull requests
pull_request:
# trigger on all commits to main
push:
branches:
- 'main'
# trigger on request
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
test:
name: test (${{ matrix.os }}, ${{ matrix.python }}, ${{ matrix.dependencies }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
# Unused key to force creation of new entries in the matrix
default: ['true']
include:
# Defaults to newest dependencies
- dependencies: 'newest'
# Oldest dependency tests
- python: '3.8'
dependencies: 'oldest'
- os: 'macos-latest'
python: '3.8'
dependencies: 'oldest'
- os: 'windows-latest'
python: '3.8'
dependencies: 'oldest'
# Newest version tests for non-Linux OS
- os: 'ubuntu-latest'
python: '3.12'
dependencies: 'newest'
- os: 'macos-latest'
python: '3.12'
dependencies: 'newest'
- os: 'windows-latest'
python: '3.12'
dependencies: 'newest'
# Minimal dependencies tests
- default: 'false'
os: 'ubuntu-latest'
python: '3.12'
dependencies: 'minimal'
- os: 'macos-14'
python: '3.12'
dependencies: 'minimal'
- os: 'windows-latest'
python: '3.12'
dependencies: 'minimal'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install newest dependencies
run: |
pip install -r requirements/requirements-test.txt
pip install -r requirements/requirements-test-optional.txt
if: ${{ matrix.dependencies == 'newest' }}
- name: Install minimal dependencies
run: |
pip install -r requirements/requirements-test.txt
if: ${{ matrix.dependencies == 'minimal' }}
- name: Install oldest supported dependencies
# To prevent Dependabot from updating the pinnings in this "oldest"
# dependency list, we have to avoid the word "requirements" in the
# filename. That's why it is in the .github/ directory and named "reqs"
# instead of "requirements."
run: |
pip install -r .github/workflows/ci-oldest-reqs.txt
if: ${{ matrix.dependencies == 'oldest' }}
- name: Install the package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest --cov=signac --cov-config=pyproject.toml --cov-report=xml tests/ -v
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}