-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (73 loc) · 2.08 KB
/
unittests.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
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
tests:
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
os:
- ubuntu-latest
- windows-latest
- macos-latest
# macos-latest does not support python 3.9
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.9", os: "macos-13" }
runs-on: ${{ matrix.os }}
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
cache-dependency-path: pyproject.toml
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install test dependencies
run: pip install -e .[test]
- name: Test with pytest
run: pytest --ignore=tests/integration
# Integration tests are slow, so only run if all other tests pass.
- name: Test integration tests
run: pytest tests/integration
tests-pinned:
name: Run tests with pinned package versions
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-test.txt
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install test dependencies
run: pip install --no-dependencies -r requirements-test.txt
- name: Test with pytest
run: pytest --ignore=tests/integration
# Integration tests are slow, so only run if all other tests pass.
- name: Test integration tests
run: pytest tests/integration