-
-
Notifications
You must be signed in to change notification settings - Fork 49
123 lines (108 loc) · 4.24 KB
/
Copy pathbuild.yml
File metadata and controls
123 lines (108 loc) · 4.24 KB
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
name: Tests
on:
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
build_wheels:
name: Build and test on ${{ matrix.os }}${{ matrix.numpy-version && format(' (numpy {0})', matrix.numpy-version) || matrix.python-version && format(' (python {0})', matrix.python-version) || '' }}
runs-on: ${{ matrix.os }}
env:
CMAKE_GENERATOR: Ninja
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12"]
numpy-version: [null]
include:
- os: ubuntu-latest
python-version: "3.12"
numpy-version: "1.26"
- os: ubuntu-latest
python-version: "3.14"
numpy-version: null
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install sccache (Windows)
if: runner.os == 'Windows'
run: choco install sccache --yes
- name: Cache sccache (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v6
with:
path: C:\Users\runneradmin\AppData\Local\sccache
key: sccache-${{ runner.os }}-${{ github.sha }}
restore-keys: |
sccache-${{ runner.os }}-
- name: Cache pip (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v6
with:
path: C:\Users\runneradmin\AppData\Local\pip\Cache
key: pip-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Install Ninja
run: pip install ninja
- name: Add LLVM to PATH (Windows)
if: runner.os == 'Windows'
run: echo "C:\\Program Files\\LLVM\\bin" >> $env:GITHUB_PATH
- name: Install specific numpy version
if: matrix.numpy-version
run: pip install "numpy==${{ matrix.numpy-version }}.*"
- name: Build (Windows)
if: runner.os == 'Windows'
id: build_windows
run: pip install -e . --group test
env:
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
SCCACHE_DIR: C:\Users\runneradmin\AppData\Local\sccache
CC: clang-cl
CXX: clang-cl
CMAKE_BUILD_PARALLEL_LEVEL: 8
SKBUILD_PARALLEL_LEVEL: 8
- name: Build (non-Windows)
if: runner.os != 'Windows'
id: build_non_windows
run: pip install -e . --group test
- name: Test (Windows)
if: runner.os == 'Windows'
run: python -m pytest -m "not heavy and not network" --durations=25
# env:
# BLOSC_NTHREADS: "1"
# NUMEXPR_NUM_THREADS: "1"
# OMP_NUM_THREADS: "1"
- name: Test (non-Windows)
if: runner.os != 'Windows'
run: python -m pytest -m "not heavy and not network" --durations=25
# The network tests talk to a live Caterva2 server and were 24 of the 25
# slowest tests in *both* the Windows and Linux jobs, with near-identical
# times -- so what they measure is server round-trip latency, not anything
# about the OS. Running them on Linux alone therefore loses no signal, and
# stops five jobs per push hammering a third-party service.
#
# --dist load, not the loadfile default: these are latency-bound and
# independent, so per-file pinning parks ~165 s of test_c2array_expr.py on
# one worker while the rest idle. `load` is unsafe for the suite at large
# (see pytest.ini) but the modules it breaks are not network-marked, so
# they are not in this selection at all.
#
# -n 8 on a 4-core runner: these tests wait on sockets rather than compute,
# so workers well past the core count still help. 8 is the point of
# diminishing returns, not a round number -- the floor is the single
# slowest test (test_mix_operands, ~42 s), which no amount of workers beats.
#
# The condition names one matrix entry rather than testing `runner.os`:
# three of the five jobs are ubuntu, so `runner.os == 'Linux'` ran this
# three times per push.
- name: Test network access
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && !matrix.numpy-version
run: python -m pytest -m "network and not heavy" -n 8 --dist load --durations=10