Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI, MAINT: Add docs-only option to CI #26316

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/commit_message.yml
@@ -0,0 +1,35 @@
name: Skip tag checker

on:
workflow_call:
outputs:
message:
description: "Skip tag checker"
value: ${{ jobs.check_skip_tags.outputs.message }}

permissions:
contents: read

jobs:
check_skip_tags:
name: Check for skips
runs-on: ubuntu-latest
outputs:
message: ${{ steps.skip_check.outputs.message }}
steps:
- name: Checkout numpy
uses: actions/checkout@v4.1.1
# Gets the correct commit message for pull request
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check for skips
id: skip_check
run: |
set -xe
COMMIT_MSG=$(git log --no-merges -1)
RUN="1"
if [[ "$COMMIT_MSG" == *"[docs only]"* ]]; then
RUN="0"
fi
echo "message=$RUN" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
5 changes: 5 additions & 0 deletions .github/workflows/cygwin.yml
Expand Up @@ -13,7 +13,12 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already skips the run if not docs-only, right? Can we encode that into the name?

In general, I think having [docs only] is awesome (a github label might also be, easier to add by maintainer, but a different thing).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the naming in SciPy is historical as an existing job was modified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I would ping since I just saw a suggestion to add the three skips we currently need.
Not sure if there is anything else holding it up. But, assuming it works, from my side it seems ready with that rename to clarify what the needs: does below.


cygwin_build_test:
needs: get_commit_message
runs-on: windows-latest
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/linux.yml
Expand Up @@ -27,6 +27,11 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:

get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

lint:
# To enable this job and subsequent jobs on a fork, comment out:
if: github.repository == 'numpy/numpy' && github.event_name != 'push'
Expand All @@ -50,6 +55,7 @@ jobs:
smoke_test:
# To enable this job on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
env:
MESON_ARGS: "-Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none"
Expand All @@ -67,7 +73,7 @@ jobs:
- uses: ./.github/meson_actions

pypy:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand All @@ -85,7 +91,7 @@ jobs:
- uses: ./.github/meson_actions

debug:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand Down Expand Up @@ -115,7 +121,7 @@ jobs:

full:
# Build a wheel, install it, then run the full test suite with code coverage
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -151,7 +157,7 @@ jobs:
# TODO: gcov

benchmark:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand Down Expand Up @@ -182,7 +188,7 @@ jobs:
spin bench --quick

sdist:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand Down Expand Up @@ -215,7 +221,7 @@ jobs:
pytest --pyargs numpy -m "not slow"

array_api_tests:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand Down Expand Up @@ -252,7 +258,7 @@ jobs:
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

custom_checks:
needs: [smoke_test]
needs: [smoke_test, get_commit_message]
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/linux_blas.yml
Expand Up @@ -53,9 +53,14 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

openblas32_stable_nightly:
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -119,6 +124,7 @@ jobs:

openblas_no_pkgconfig_fedora:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
container: fedora:39
name: "OpenBLAS (Fedora, no pkg-config, LP64/ILP64)"
Expand Down Expand Up @@ -154,6 +160,7 @@ jobs:

flexiblas_fedora:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
container: fedora:39
name: "FlexiBLAS (LP64, ILP64 on Fedora)"
Expand Down Expand Up @@ -189,6 +196,7 @@ jobs:

openblas_cmake:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
name: "OpenBLAS with CMake"
steps:
Expand Down Expand Up @@ -217,6 +225,7 @@ jobs:

netlib-debian:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
name: "Debian libblas/liblapack"
steps:
Expand Down Expand Up @@ -246,6 +255,7 @@ jobs:

netlib-split:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
container: opensuse/tumbleweed
name: "OpenSUSE Netlib BLAS/LAPACK"
Expand Down Expand Up @@ -277,6 +287,7 @@ jobs:

mkl:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
name: "MKL (LP64, ILP64, SDL)"
steps:
Expand Down Expand Up @@ -340,6 +351,7 @@ jobs:

blis:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
name: "BLIS"
steps:
Expand Down Expand Up @@ -376,6 +388,7 @@ jobs:

atlas:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
name: "ATLAS"
steps:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/linux_compiler_sanitizers.yml
Expand Up @@ -21,9 +21,15 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:

get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

clang_sanitizers:
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux_musl.yml
Expand Up @@ -17,10 +17,15 @@ permissions:


jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

musllinux_x86_64:
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
container:
# Use container used for building musllinux wheels
# it has git installed, all the pythons, etc
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux_qemu.yml
Expand Up @@ -27,9 +27,14 @@ permissions:
contents: read

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

linux_qemu:
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux_simd.yml
Expand Up @@ -51,9 +51,14 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

baseline_only:
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
env:
MESON_ARGS: "-Dallow-noblas=true -Dcpu-dispatch=none"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/macos.yml
Expand Up @@ -17,10 +17,15 @@ concurrency:
cancel-in-progress: true

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

x86_conda:
name: macOS x86-64 conda
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: macos-13
strategy:
fail-fast: false
Expand Down Expand Up @@ -105,6 +110,7 @@ jobs:
accelerate:
name: Accelerate (LP64, ILP64) - ${{ matrix.build_runner[1] }}
if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ${{ matrix.build_runner[0] }}
strategy:
fail-fast: false
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/mypy.yml
Expand Up @@ -37,9 +37,14 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml

mypy:
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
name: "MyPy"
runs-on: ${{ matrix.os_python[0] }}
strategy:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/windows.yml
Expand Up @@ -14,8 +14,12 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml
python64bit_openblas:
name: x86-64, LP64 OpenBLAS
needs: get_commit_message
runs-on: windows-2019
# To enable this job on a fork, comment out:
if: github.repository == 'numpy/numpy'
Expand Down Expand Up @@ -83,6 +87,7 @@ jobs:
runs-on: windows-2019
# To enable this job on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_message
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Expand Up @@ -28,7 +28,7 @@ stages:
git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "`
echo "##vso[task.setvariable variable=log]$git_log"
- bash: echo "##vso[task.setvariable variable=RET]false"
condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))
condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'), contains(variables.log, '[docs only]'), contains(variables.log, '[lint only]'))
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET"
name: result

Expand Down
6 changes: 6 additions & 0 deletions doc/source/dev/development_workflow.rst
Expand Up @@ -177,6 +177,8 @@ Standard acronyms to start the commit message with are::
TYP: static typing
REL: related to releasing numpy

.. _skip-ci:

Commands to skip continuous integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -223,6 +225,10 @@ these fragments in each commit message of a PR:
uploads.
`See the configuration file for these checks. <https://github.com/numpy/numpy/blob/main/.cirrus.star>`__

* ``[docs only]``: Run only the documentation check

This is useful if you are only making changes to the documentation.

Test building wheels
~~~~~~~~~~~~~~~~~~~~

Expand Down