8000 CI: split `build_test.yml` into three GHA jobs files · rgommers/numpy@a238cc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit a238cc5

Browse files
committed
CI: split build_test.yml into three GHA jobs files
Also documents better what is being run. See numpygh-24410 for the overall restructuring plan for GitHub Actions CI.
1 parent ed1aac0 commit a238cc5

File tree

3 files changed

+274
-181
lines changed

3 files changed

+274
-181
lines changed

.github/workflows/linux.yml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
name: Linux tests
2+
3+
# This file is meant for testing across supported Python versions, build types
4+
# and interpreters (PyPy, python-dbg, a pre-release Python in summer time),
5+
# build-via-sdist, run benchmarks, measure code coverage, and other build
6+
# options like relaxed-strides.
7+
8+
on:
9+
push:
10+
branches:
11+
# coverage comparison in the "full" step needs to run on main after merges
12+
- main
13+
pull_request:
14+
branches:
15+
- main
16+
- maintenance/**
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
env:
23+
DOWNLOAD_OPENBLAS: 1
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
27+
cancel-in-progress: true
28+
29+
permissions:
30+
contents: read # to fetch code (actions/checkout)
31+
32+
jobs:
33+
lint:
34+
if: github.repository == 'numpy/numpy' && github.event_name != 'push'
35+
runs-on: ubuntu-latest
36+
continue-on-error: true
37+
steps:
38+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
39+
with:
40+
submodules: recursive
41+
fetch-depth: 0
42+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
43+
with:
44+
python-version: '3.9'
45+
- name: Install linter requirements
46+
run:
47+
python -m pip install -r linter_requirements.txt
48+
- name: Run linter on PR diff
49+
run:
50+
python tools/linter.py --branch origin/${{ github.base_ref }}
51+
52+
smoke_test:
53+
if: "github.repository == 'numpy/numpy'"
54+
runs-on: ubuntu-latest
55+
env:
56+
MESON_ARGS: "-Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none"
57+
steps:
58+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
59+
with:
60+
submodules: recursive
61+
fetch-depth: 0
62+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
63+
with:
64+
python-version: '3.9'
65+
- uses: ./.github/meson_actions
66+
67+
basic:
68+
needs: [smoke_test]
69+
runs-on: ubuntu-latest
70+
if: github.event_name != 'push'
71+
strategy:
72+
matrix:
73+
python-version: ["3.9", "pypy3.9-v7.3.12"]
74+
env:
75+
EXPECT_CPU_FEATURES: "SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_KNM AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL"
76+
steps:
77+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
78+
with:
79+
submodules: recursive
80+
fetch-depth: 0
81+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
82+
with:
83+
python-version: ${{ matrix.python-version }}
84+
- uses: ./.github/actions
85+
86+
debug:
87+
needs: [smoke_test]
88+
runs-on: ubuntu-latest
89+
if: github.event_name != 'push'
90+
env:
91+
USE_DEBUG: 1
92+
steps:
93+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
94+
with:
95+
submodules: recursive
96+
fetch-depth: 0
97+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
98+
with:
99+
python-version: '3.11'
100+
101+
- uses: ./.github/actions
102+
103+
full:
104+
# Build a wheel, install it, then run the full test suite with code coverage
105+
needs: [smoke_test]
106+
runs-on: ubuntu-22.04
107+
steps:
108+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
109+
with:
110+
submodules: recursive
111+
fetch-depth: 0
112+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
113+
with:
114+
python-version: '3.9'
115+
- name: Install build and test dependencies from PyPI
116+
run: |
117+
pip install -r build_requirements.txt
118+
pip install -r test_requirements.txt
119+
- name: Install gfortran and OpenBLAS (MacPython build)
120+
run: |
121+
set -xe
122+
sudo apt install gfortran libgfortran5
123+
target=$(python tools/openblas_support.py)
124+
sudo cp -r $target/lib/* /usr/lib
125+
sudo cp $target/include/* /usr/include
126+
- name: Build a wheel
127+
run: |
128+
python -m build --wheel --no-isolation --skip-dependency-checks
129+
- name: Run full test suite
130+
run: |
131+
cd doc
132+
pytest --pyargs numpy --cov-report=html:build/coverage
133+
# TODO: gcov
134+
135+
benchmark:
136+
needs: [smoke_test]
137+
runs-on: ubuntu-latest
138+
if: github.event_name != 'push'
139+
env:
140+
PYTHONOPTIMIZE: 2
141+
BLAS: None
142+
LAPACK: None
143+
ATLAS: None
144+
NPY_BLAS_ORDER: mkl,blis,openblas,atlas,blas
145+
NPY_LAPACK_ORDER: MKL,OPENBLAS,ATLAS,LAPACK
146+
USE_ASV: 1
147+
steps:
148+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
149+
with:
150+
submodules: recursive
151+
fetch-depth: 0
152+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
153+
with:
154+
python-version: '3.9'
155+
- uses: ./.github/actions
156+
157+
relaxed_strides_debug:
158+
needs: [smoke_test]
159+
runs-on: ubuntu-latest
160+
if: github.event_name != 'push'
161+
env:
162+
CHECK_BLAS: 1
163+
NPY_USE_BLAS_ILP64: 1
164+
NPY_RELAXED_STRIDES_DEBUG: 1
165+
steps:
166+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
167+
with:
168+
submodules: recursive
169+
fetch-depth: 0
170+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
171+
with:
172+
python-version: '3.11'
173+
- uses: ./.github/actions
174+
175+
sdist:
176+
needs: [smoke_test]
177+
runs-on: ubuntu-latest
178+
if: github.event_name != 'push'
179+
steps:
180+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
181+
with:
182+
submodules: recursive
183+
fetch-depth: 0
184+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
185+
with:
186+
python-version: '3.12'
187+
- name: Install gfortran and OpenBLAS (MacPython build)
188+
run: |
189+
set -xe
190+
sudo apt install gfortran libgfortran5
191+
target=$(python tools/openblas_support.py)
192+
sudo cp -r $target/lib/* /usr/lib
193+
sudo cp $target/include/* /usr/include
194+
- name: Build a wheel via an sdist
195+
run: |
196+
python -m build
197+
pip install dist/numpy*.whl
198+
- name: Install test dependencies
199+
run: |
200+
pip install -r test_requirements.txt
201+
- name: Run test suite
202+
run: |
203+
cd doc
204+
pytest --pyargs numpy -m "not slow"
205+

.github/workflows/linux_blas.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: BLAS tests (Linux)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- maintenance/**
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read # to fetch code (actions/checkout)
19+
20+
jobs:
21+
openblas64:
22+
runs-on: ubuntu-latest
23+
if: github.event_name != 'push'
24+
env:
25+
DOWNLOAD_OPENBLAS: 1
26+
NPY_USE_BLAS_ILP64: 1
27+
steps:
28+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
29+
with:
30+
submodules: recursive
31+
fetch-depth: 0
32+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
33+
with:
34+
python-version: '3.11'
35+
- uses: ./.github/actions
36+

0 commit comments

Comments
 (0)
0