-
Notifications
You must be signed in to change notification settings - Fork 44
182 lines (157 loc) · 5.49 KB
/
Copy pathtests.yml
File metadata and controls
182 lines (157 loc) · 5.49 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: tests
on:
push:
branches: [main]
paths-ignore:
- "*.md"
pull_request:
branches: ["*"]
paths-ignore:
- "*.md"
workflow_dispatch: # allows you to trigger manually
permissions: {}
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
env:
MODULE_NAME: 'blis'
RUN_MYPY: 'false'
jobs:
tests:
name: Test
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest # x64
- ubuntu-24.04-arm # ARM
- macos-15-intel # x64
- macos-latest # ARM
- windows-latest # x64
- windows-11-arm # ARM
python_version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
cc: [''] # default: gcc on Linux; clang on Mac/Windows
numpy-runtime: [''] # default: latest version
include:
# Note: default compiler for Linux is gcc. cibuildwheel uses gcc.
# FIXME: clang crashes on ARM Linux
- os: ubuntu-latest
python_version: "3.10"
cc: clang
- os: ubuntu-latest
python_version: "3.14"
cc: clang
# Test oldest runtime version of NumPy.
# Note that we always use the latest available version for building.
- os: ubuntu-latest
python_version: "3.10"
numpy-runtime: "1.21.2"
- os: ubuntu-24.04-arm
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: macos-15-intel
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: macos-latest
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: windows-latest
python_version: "3.10"
numpy-runtime: "1.21.3"
- os: windows-11-arm
python_version: "3.11"
numpy-runtime: "2.3.1"
exclude:
- os: windows-11-arm
python_version: "3.10"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure Python version
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python_version }}
# Install LLVM on Windows
- name: Install LLVM on Windows x64
if: matrix.os == 'windows-latest'
run: |
choco install llvm --version=18.1.8 -y --force
echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH
- name: Install LLVM on Windows ARM64
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: |
Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/LLVM-20.1.6-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe
Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install dependencies
run: |
python -m pip install -U build pip setuptools wheel
- name: Build wheel (Windows)
if: startsWith(matrix.os, 'windows')
run: |
dir "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build" /b
set "PATH=C:\Program Files\LLVM\bin;%PATH%"
set "AR=llvm-ar"
set "AS=llvm-as"
set "CC=clang"
set RANLIB=echo
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\vcvarsall.bat" amd64
clang --version
python -m build --wheel
shell: cmd
- name: Build wheel (Mac)
if: startsWith(matrix.os, 'macos')
run: |
clang --version
python -m build --wheel
- name: Build wheel (Linux / gcc)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == ''
run: |
gcc --version
python -m build --wheel
- name: Build wheel (Linux / clang)
if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'clang'
run: |
clang --version
CC=clang python -m build --wheel
# TODO: install mypy from requirements if reenabled
- name: Run mypy
shell: bash
if: env.RUN_MYPY == 'true'
run: |
python -m mypy $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install wheel
if: matrix.numpy-runtime == ''
shell: bash
run: |
python -m pip install dist/*.whl
- name: Install wheel with pinned NumPy
if: matrix.numpy-runtime != ''
shell: bash
run: |
python -m pip install numpy==${{ matrix.numpy-runtime }}
python -m pip install --no-deps dist/*.whl
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: python -m pip install -r requirements.txt
- name: Run tests
run: pytest
- name: Run pytest-run-parallel
if: endsWith(matrix.python_version, 't')
run: pytest --parallel-threads 4