-
Notifications
You must be signed in to change notification settings - Fork 13
96 lines (82 loc) · 2.67 KB
/
python-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
name: Python tests
on:
push:
branches: [main]
pull_request:
# Check all PR
concurrency:
group: python-tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
tests:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
container: ${{ matrix.container }}
strategy:
matrix:
include:
- os: ubuntu-22.04
python-version: "3.9"
- os: ubuntu-22.04
python-version: "3.12"
- os: macos-14
python-version: "3.12"
- os: windows-2019
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- name: setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"
- name: Setup sccache environnement variables
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
- name: run tox
run: tox
env:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
# second set of jobs checking that (non-test) code still compiles/run as expected
prevent-bitrot:
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} / check build
strategy:
matrix:
python-version: ['3.9', '3.12']
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: python build tests
run: tox -e build-python
env:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu