-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (80 loc) · 2.26 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
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: install clang-format
run: |
pip install clang-format==6.0.1
- uses: pre-commit/[email protected]
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.9, 3.12 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{matrix.python}}
- name: Install pip deps
run: python -m pip install -r python/requirements/CI/tests/requirements.txt
- name: Build module
working-directory: python
run: |
python -m pip install .
- name: Run tests
working-directory: python
run: |
python -m pytest tests
numpy-versions:
name: Numpy compat
runs-on: ubuntu-latest
strategy:
matrix:
numpy: [ 1.23.5, "2.0" ]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install numpy
run: python -m pip install numpy==${{matrix.numpy}}
- name: Install package
working-directory: python
run: |
python -m pip install .
- name: Install pip deps
run: |
python -m pip install -r python/requirements/CI/tests/requirements.txt
# Make sure we're still using the same version of numpy
python -m pip install numpy==${{matrix.numpy}}
- name: Run tests
working-directory: python
run: |
python -m pytest tests