8000 CI, MAINT: Add docs-only and lint-only options to CI · melissawm/numpy@2ab17a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ab17a4

Browse files
CI, MAINT: Add docs-only and lint-only options to CI
Borrows logic from SciPy CI Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
1 parent da95f8e commit 2ab17a4

File tree

11 files changed

+103
-7
lines changed

11 files changed

+103
-7
lines changed

.github/workflows/commit_message.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Skip tag checker
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
message:
7+
description: "Skip tag checker"
8+
value: ${{ jobs.check_skip_tags.outputs.message }}
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
check_skip_tags:
15+
name: Check for skips
16+
runs-on: ubuntu-latest
17+
outputs:
18+
message: ${{ steps.skip_check.outputs.message }}
19+
steps:
20+
- name: Checkout numpy
21+
uses: actions/checkout@v4.1.1
22+
# Gets the correct commit message for pull request
23+
with:
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
- name: Check for skips
26+
id: skip_check
27+
run: |
28+
set -xe
29+
COMMIT_MSG=$(git log --no-merges -1)
30+
RUN="1"
31+
if [[ "$COMMIT_MSG" == *"[docs only]"* ]]; then
32+
RUN="0"
33+
fi
34+
echo "message=$RUN" >> $GITHUB_OUTPUT
35+
echo github.ref ${{ github.ref }}

.github/workflows/cygwin.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ permissions:
1313
contents: read # to fetch code (actions/checkout)
1414

1515
jobs:
16+
get_commit_message:
17+
name: Get commit message
18+
uses: ./.github/workflows/commit_message.yml
19+
1620
cygwin_build_test:
21+
needs: get_commit_message
1722
runs-on: windows-latest
1823
# To enable this workflow on a fork, comment out:
1924
if: github.repository == 'numpy/numpy'

.github/workflows/linux.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ permissions:
2727
contents: read # to fetch code (actions/checkout)
2828

2929
jobs:
30+
31+
get_commit_message:
32+
name: Get commit message
33+
uses: ./.github/workflows/commit_message.yml
34+
3035
lint:
3136
# To enable this job and subsequent jobs on a fork, comment out:
3237
if: github.repository == 'numpy/numpy' && github.event_name != 'push'
@@ -50,6 +55,7 @@ jobs:
5055
smoke_test:
5156
# To enable this job on a fork, comment out:
5257
if: github.repository == 'numpy/numpy'
58+
needs: get_commit_message
5359
runs-on: ubuntu-latest
5460
env:
5561
MESON_ARGS: "-Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none"
@@ -67,7 +73,7 @@ jobs:
6773
- uses: ./.github/meson_actions
6874

6975
pypy:
70-
needs: [smoke_test]
76+
needs: [smoke_test, get_commit_message]
7177
runs-on: ubuntu-latest
7278
if: github.event_name != 'push'
7379
steps:
@@ -85,7 +91,7 @@ jobs:
8591
- uses: ./.github/meson_actions
8692

8793
debug:
88-
needs: [smoke_test]
94+
needs: [smoke_test, get_commit_message]
8995
runs-on: ubuntu-latest
9096
if: github.event_name != 'push'
9197
steps:
@@ -115,7 +121,7 @@ jobs:
115121
116122
full:
117123
# Build a wheel, install it, then run the full test suite with code coverage
118-
needs: [smoke_test]
124+
needs: [smoke_test, get_commit_message]
119125
runs-on: ubuntu-22.04
120126
steps:
121127
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -151,7 +157,7 @@ jobs:
151157
# TODO: gcov
152158
153159
benchmark:
154-
needs: [smoke_test]
160+
needs: [smoke_test, get_commit_message]
155161
runs-on: ubuntu-latest
156162
if: github.event_name != 'push'
157163
steps:
@@ -182,7 +188,7 @@ jobs:
182188
spin bench --quick
183189
184190
sdist:
185-
needs: [smoke_test]
191+
needs: [smoke_test, get_commit_message]
186192
runs-on: ubuntu-latest
187193
if: github.event_name != 'push'
188194
steps:
@@ -215,7 +221,7 @@ jobs:
215221
pytest --pyargs numpy -m "not slow"
216222
217223
array_api_tests:
218-
needs: [smoke_test]
224+
needs: [smoke_test, get_commit_message]
219225
runs-on: ubuntu-latest
220226
if: github.event_name != 'push'
221227
steps:
@@ -252,7 +258,7 @@ jobs:
252258
pytest array_api_tests -v -c pytest.ini --ci --max-examples=2 --derandomize --disable-deadline --skips-file ${GITHUB_WORKSPACE}/tools/ci/array-api-skips.txt
253259
254260
custom_checks:
255-
needs: [smoke_test]
261+
needs: [smoke_test, get_commit_message]
256262
runs-on: ubuntu-latest
257263
if: github.event_name != 'push'
258264
steps:

.github/workflows/linux_blas.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@ permissions:
5353
contents: read # to fetch code (actions/checkout)
5454

5555
jobs:
56+
get_commit_message:
57+
name: Get commit message
58+
uses: ./.github/workflows/commit_message.yml
59+
5660
openblas32_stable_nightly:
5761
# To enable this workflow on a fork, comment out:
5862
if: github.repository == 'numpy/numpy'
63+
needs: get_commit_message
5964
runs-on: ubuntu-latest
6065
strategy:
6166
fail-fast: false
@@ -119,6 +124,7 @@ jobs:
119124
120125
openblas_no_pkgconfig_fedora:
121126
if: github.repository == 'numpy/numpy'
127+
needs: get_commit_message
122128
runs-on: ubuntu-latest
123129
container: fedora:39
124130
name: "OpenBLAS (Fedora, no pkg-config, LP64/ILP64)"
@@ -154,6 +160,7 @@ jobs:
154160

155161
flexiblas_fedora:
156162
if: github.repository == 'numpy/numpy'
163+
needs: get_commit_message
157164
runs-on: ubuntu-latest
158165
container: fedora:39
159166
name: "FlexiBLAS (LP64, ILP64 on Fedora)"
@@ -189,6 +196,7 @@ jobs:
189196

190197
openblas_cmake:
191198
if: github.repository == 'numpy/numpy'
199+
needs: get_commit_message
192200
runs-on: ubuntu-latest
193201
name: "OpenBLAS with CMake"
194202
steps:
@@ -217,6 +225,7 @@ jobs:
217225

218226
netlib-debian:
219227
if: github.repository == 'numpy/numpy'
228+
needs: get_commit_message
220229
runs-on: ubuntu-latest
221230
name: "Debian libblas/liblapack"
222231
steps:
@@ -246,6 +255,7 @@ jobs:
246255
247256
netlib-split:
248257
if: github.repository == 'numpy/numpy'
258+
needs: get_commit_message
249259
runs-on: ubuntu-latest
250260
container: opensuse/tumbleweed
251261
name: "OpenSUSE Netlib BLAS/LAPACK"
@@ -277,6 +287,7 @@ jobs:
277287
278288
mkl:
279289
if: github.repository == 'numpy/numpy'
290+
needs: get_commit_message
280291
runs-on: ubuntu-latest
281292
name: "MKL (LP64, ILP64, SDL)"
282293
steps:
@@ -340,6 +351,7 @@ jobs:
340351

341352
blis:
342353
if: github.repository == 'numpy/numpy'
354+
needs: get_commit_message
343355
runs-on: ubuntu-latest
344356
name: "BLIS"
345357
steps:
@@ -376,6 +388,7 @@ jobs:
376388

377389
atlas:
378390
if: github.repository == 'numpy/numpy'
391+
needs: get_commit_message
379392
runs-on: ubuntu-latest
380393
name: "ATLAS"
381394
steps:

.github/workflows/linux_compiler_sanitizers.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ permissions:
2121
contents: read # to fetch code (actions/checkout)
2222

2323
jobs:
24+
25+
get_commit_message:
26+
name: Get commit message
27+
uses: ./.github/workflows/commit_message.yml
28+
2429
clang_sanitizers:
2530
# To enable this workflow on a fork, comment out:
2631
if: github.repository == 'numpy/numpy'
32+
needs: get_commit_message
2733
runs-on: ubuntu-latest
2834
steps:
2935
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

.github/workflows/linux_musl.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ permissions:
1717

1818

1919
jobs:
20+
get_commit_message:
21+
name: Get commit message
22+
uses: ./.github/workflows/commit_message.yml
23+
2024
musllinux_x86_64:
2125
runs-on: ubuntu-latest
2226
# To enable this workflow on a fork, comment out:
2327
if: github.repository == 'numpy/numpy'
28+
needs: get_commit_message
2429
container:
2530
# Use container used for building musllinux wheels
2631
# it has git installed, all the pythons, etc

.github/workflows/linux_qemu.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ permissions:
2727
contents: read
2828

2929
jobs:
30+
get_commit_message:
31+
name: Get commit message
32+
uses: ./.github/workflows/commit_message.yml
33+
3034
linux_qemu:
3135
# To enable this workflow on a fork, comment out:
3236
if: github.repository == 'numpy/numpy'
37+
needs: get_commit_message
3338
runs-on: ubuntu-22.04
3439
continue-on-error: true
3540
strategy:

.github/workflows/linux_simd.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ permissions:
5151
contents: read # to fetch code (actions/checkout)
5252

5353
jobs:
54+
get_commit_message:
55+
name: Get commit message
56+
uses: ./.github/workflows/commit_message.yml
57+
5458
baseline_only:
5559
# To enable this workflow on a fork, comment out:
5660
if: github.repository == 'numpy/numpy'
61+
needs: get_commit_message
5762
runs-on: ubuntu-latest
5863
env:
5964
MESON_ARGS: "-Dallow-noblas=true -Dcpu-dispatch=none"

.github/workflows/macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
get_commit_message:
21+
name: Get commit message
22+
uses: ./.github/workflows/commit_message.yml
23+
2024
x86_conda:
2125
name: macOS x86-64 conda
2226
# To enable this workflow on a fork, comment out:
2327
if: github.repository == 'numpy/numpy'
28+
needs: get_commit_message
2429
runs-on: macos-13
2530
strategy:
2631
fail-fast: false
@@ -105,6 +110,7 @@ jobs:
105110
accelerate:
106111
name: Accelerate (LP64, ILP64) - ${{ matrix.build_runner[1] }}
107112
if: github.repository == 'numpy/numpy'
113+
needs: get_commit_message
108114
runs-on: ${{ matrix.build_runner[0] }}
109115
strategy:
110116
fail-fast: false

.github/workflows/mypy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ permissions:
3737
contents: read # to fetch code (actions/checkout)
3838

3939
jobs:
40+
get_commit_message:
41+
name: Get commit message
42+
uses: ./.github/workflows/commit_message.yml
43+
4044
mypy:
4145
# To enable this workflow on a fork, comment out:
4246
if: github.repository == 'numpy/numpy'
47+
needs: get_commit_message
4348
name: "MyPy"
4449
runs-on: ${{ matrix.os_python[0] }}
4550
strategy:

0 commit comments

Comments
 (0)
0