8000 Merge pull request #24493 from rgommers/ci-meson · numpy/numpy@cf3b7e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf3b7e0

Browse files
authored
Merge pull request #24493 from rgommers/ci-meson
CI: GitHub Actions CI job restructuring
2 parents 7a37bb1 + 6d34380 commit cf3b7e0

File tree

7 files changed

+315
-301
lines changed

7 files changed

+315
-301
lines changed

.github/actions/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ runs:
1111
echo DOWNLOAD_OPENBLAS $DOWNLOAD_OPENBLAS
1212
echo USE_DEBUG $USE_DEBUG
1313
echo NPY_USE_BLAS_ILP64 $NPY_USE_BLAS_ILP64
14-
echo NUMPY_EXPERIMENTAL_ARRAY_FUNCTION $NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
1514
echo USE_ASV $USE_ASV
1615
echo PATH $PATH
1716
echo python `which python`

.github/workflows/linux.yml

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
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-check
129+
pip install dist/numpy*.whl
130+
- name: Run full test suite
131+
run: |
132+
cd tools
133+
pytest --pyargs numpy --cov-report=html:build/coverage
134+
# TODO: gcov
135+
136+
benchmark:
137+
needs: [smoke_test]
138+
runs-on: ubuntu-latest
139+
if: github.event_name != 'push'
140+
env:
141+
PYTHONOPTIMIZE: 2
142+
BLAS: None
143+
LAPACK: None
144+
ATLAS: None
145+
NPY_BLAS_ORDER: mkl,blis,openblas,atlas,blas
146+
NPY_LAPACK_ORDER: MKL,OPENBLAS,ATLAS,LAPACK
147+
USE_ASV: 1
148+
steps:
149+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
150+
with:
151+
submodules: recursive
152+
fetch-depth: 0
153+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
154+
with:
155+
python-version: '3.9'
156+
- uses: ./.github/actions
157+
158+
relaxed_strides_debug:
159+
needs: [smoke_test]
160+
runs-on: ubuntu-latest
161+
if: github.event_name != 'push'
162+
env:
163+
CHECK_BLAS: 1
164+
NPY_USE_BLAS_ILP64: 1
165+
NPY_RELAXED_STRIDES_DEBUG: 1
166+
steps:
167+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
168+
with:
169+
submodules: recursive
170+
fetch-depth: 0
171+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
172+
with:
173+
python-version: '3.11'
174+
- uses: ./.github/actions
175+
176+
sdist:
177+
needs: [smoke_test]
178+
runs-on: ubuntu-latest
179+
if: github.event_name != 'push'
180+
steps:
181+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
182+
with:
183+
submodules: recursive
184+
fetch-depth: 0
185+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
186+
with:
187+
python-version: '3.11'
188+
- name: Install gfortran and OpenBLAS (MacPython build)
189+
run: |
190+
set -xe
191+
sudo apt install gfortran libgfortran5
192+
target=$(python tools/openblas_support.py)
193+
sudo cp -r $target/lib/* /usr/lib
194+
sudo cp $target/include/* /usr/include
195+
- name: Build a wheel via an sdist
196+
run: |
197+
pip install build
198+
python -m build
199+
pip install dist/numpy*.whl
200+
- name: Install test dependencies
201+
run: |
202+
pip install -r test_requirements.txt
203+
pip install ninja
204+
- name: Run test suite
205+
run: |
206+
cd tools
207+
pytest --pyargs numpy -m "not slow"
208+

.github/workflows/linux_meson.yml renamed to .github/workflows/linux_blas.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
name: Test Meson build (Linux)
1+
name: BLAS tests (Linux)
2+
3+
# This file is meant for testing different BLAS/LAPACK flavors and build
4+
# options on Linux. All other yml files for Linux will only test without BLAS
5+
# (mostly because that's easier and faster to build) or with the same 64-bit
6+
# OpenBLAS build that is used in the wheel jobs.
7+
#
8+
# Jobs and their purpose:
9+
#
10+
# - openblas64_setuppy:
11+
# This job uses the default 64-bit build of OpenBLAS with the
12+
# `numpy.distutils`-based build. It can be removed once we remove
13+
# support for those builds.
14+
# - openblas32_stable_nightly:
15+
# Uses the 32-bit OpenBLAS builds, both the latest stable release and a
16+
# nightly build.
17+
#
18+
# TODO: coverage here is limited, we should add non-OpenBLAS libraries and
19+
# exercise the BLAS-related build options (see `meson_options.txt`).
220

321
on:
422
pull_request:
@@ -10,9 +28,6 @@ defaults:
1028
run:
1129
shell: bash
1230

13-
env:
14-
PYTHON_VERSION: 3.11
15-
1631
concurrency:
1732
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1833
cancel-in-progress: true
@@ -21,7 +36,23 @@ permissions:
2136
contents: read # to fetch code (actions/checkout)
2237

2338
jobs:
24-
meson_spin:
39+
openblas64_setuppy:
40+
runs-on: ubuntu-latest
41+
if: "github.repository == 'numpy/numpy'"
42+
env:
43+
DOWNLOAD_OPENBLAS: 1
44+
NPY_USE_BLAS_ILP64: 1
45+
steps:
46+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
47+
with:
48+
submodules: recursive
49+
fetch-depth: 0
50+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
51+
with:
52+
python-version: '3.11'
53+
- uses: ./.github/actions
54+
55+
openblas32_stable_nightly:
2556
if: "github.repository == 'numpy/numpy'"
2657
runs-on: ubuntu-latest
2758
strategy:
@@ -37,7 +68,8 @@ jobs:
3768
fetch-depth: 0
3869
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
3970
with:
40-
python-version: ${{ env.PYTHON_VERSION }}
71+
python-version: '3.11'
72+
4173
- name: Install dependencies
4274
run: |
4375
pip install -r build_requirements.txt
@@ -50,23 +82,28 @@ jobs:
5082
fi
5183
sudo cp -r $target/lib/* /usr/lib
5284
sudo cp $target/include/* /usr/include
85+
5386
- name: Build
5487
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
5588
env:
5689
TERM: xterm-256color
5790
run:
5891
spin build -- --werror
92+
5993
- name: Check build-internal dependencies
6094
run:
6195
ninja -C build -t missingdeps
96+
6297
- name: Check installed test and stub files
6398
run:
6499
python tools/check_installed_files.py $(find ./build-install -path '*/site-packages/numpy')
100+
65101
- name: Test
66102
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
67103
env:
68104
TERM: xterm-256color
69105
LD_LIBRARY_PATH: "/usr/local/lib/" # to find libopenblas.so.0
106+
70107
run: |
71108
pip install pytest pytest-xdist hypothesis typing_extensions
72109
spin test -j auto

0 commit comments

Comments
 (0)
0