From cfed35d30f456901a29cead7c83bd96280aeecc3 Mon Sep 17 00:00:00 2001 From: Brent Huisman Date: Wed, 2 Aug 2023 12:49:11 +0200 Subject: [PATCH] Break out pip and doc tests, exclude doc-change from eating up precious runner cycles (#2160) - Break out pip and doc tests from `test-everything.yaml` - Only trigger docs build on docs changes, and not trigger code-CI on docs-only changes. - Remove monthly submodule check. This will be handled differently, see #1731 - Enable Pypy wheel builds (they pass testing, see https://github.com/brenthuisman/arbor/actions/runs/5725359772) --- .github/workflows/benchmarks.yml | 1 + .../{release.yml => build-pip-wheels.yml} | 0 .github/workflows/check-submodules.yml | 28 -------- .github/workflows/sanitize.yml | 1 + .github/workflows/test-docs.yaml | 41 +++++++++++ .../{test-everything.yml => test-matrix.yml} | 68 +------------------ .github/workflows/test-pip.yaml | 44 ++++++++++++ .../workflows/{spack.yml => test-spack.yml} | 2 + README.md | 6 +- doc/index.rst | 16 +++-- pyproject.toml | 7 +- 11 files changed, 110 insertions(+), 104 deletions(-) rename .github/workflows/{release.yml => build-pip-wheels.yml} (100%) delete mode 100644 .github/workflows/check-submodules.yml create mode 100644 .github/workflows/test-docs.yaml rename .github/workflows/{test-everything.yml => test-matrix.yml} (75%) create mode 100644 .github/workflows/test-pip.yaml rename .github/workflows/{spack.yml => test-spack.yml} (95%) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 084f15fe40..0f2921b72a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -3,6 +3,7 @@ name: Benchmarks on: pull_request: branches: [ master ] + paths-ignore: 'doc/**' jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/build-pip-wheels.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/build-pip-wheels.yml diff --git a/.github/workflows/check-submodules.yml b/.github/workflows/check-submodules.yml deleted file mode 100644 index 48878c991f..0000000000 --- a/.github/workflows/check-submodules.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Update submodules - -on: - schedule: - # - cron: '0 2 * * 0' # run at 2 AM every sunday - - cron: '5 4 2 * *' # 04:05 every 2nd of month - push: - branches: [ 'ci/auto-update-submodules' ] - -jobs: - update_submodules: - runs-on: ubuntu-latest - steps: - - name: Clone w/ submodules - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Check submodules for updates - run: scripts/submodule-diff.sh - - name: Create Issue From File - uses: peter-evans/create-issue-from-file@v3 - with: - title: '[AUTOMATED] Git submodule updates found' - content-filepath: ./diff.log - labels: | - dependency update - assignees: brenthuisman diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index 788e5d219a..6762039add 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -3,6 +3,7 @@ name: Sanitize on: pull_request: branches: [ master ] + paths-ignore: 'doc/**' jobs: build: diff --git a/.github/workflows/test-docs.yaml b/.github/workflows/test-docs.yaml new file mode 100644 index 0000000000..7c6918f2fd --- /dev/null +++ b/.github/workflows/test-docs.yaml @@ -0,0 +1,41 @@ +name: Test docs + +on: + push: + branches: [ master ] + paths: 'doc/**' + pull_request: + branches: [ master ] + paths: 'doc/**' + +jobs: + testdocs: + name: "Docs build test" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04] + python-version: [3.7] + steps: + - name: Set up cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ matrix.config.cmake }} + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Update pip and setup venv + run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo "PATH=$PATH" >> $GITHUB_ENV + - name: Clone w/ submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install Python packages + run: python -m pip install -r doc/requirements.txt -U + - name: Build Arbor Docs + run: | + mkdir build + cd build + cmake .. -DARB_WITH_PYTHON=ON -DPython3_EXECUTABLE=`which python` -DARB_USE_BUNDLED_LIBS=ON + make html diff --git a/.github/workflows/test-everything.yml b/.github/workflows/test-matrix.yml similarity index 75% rename from .github/workflows/test-everything.yml rename to .github/workflows/test-matrix.yml index 2f8a7ce201..c760b4d8c2 100644 --- a/.github/workflows/test-everything.yml +++ b/.github/workflows/test-matrix.yml @@ -1,10 +1,12 @@ -name: Test Everything +name: Test Matrix on: push: branches: [ master ] + paths-ignore: 'doc/**' pull_request: branches: [ master ] + paths-ignore: 'doc/**' jobs: testallconfigs: @@ -191,67 +193,3 @@ jobs: # run: scripts/run_python_examples.sh - name: Test executables run: ./scripts/test_executables.sh - testpip: - name: "Pip build test + Python examples test" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04] - python-version: [3.7] - steps: - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Clone w/ submodules - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Update pip and setup venv - run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo PATH=$PATH >> $GITHUB_ENV - - name: Debug info Python - run: | - which python - python --version - pip --version - - name: Build and install Arbor using pip + build flags - run: CMAKE_ARGS="-DARB_VECTORIZE=ON -DARB_ARCH=native" pip install . --user - - name: Check that build flags match - run: | - python -c "import arbor; print(arbor.config())" | grep -q "'arch': 'native'" - - name: Run Python tests - run: python -m unittest discover -v -s python - - name: Run Python examples - run: scripts/run_python_examples.sh - - name: Test executables - run: scripts/test_executables.sh - testdocs: - name: "Docs build test" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04] - python-version: [3.7] - steps: - - name: Set up cmake - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: ${{ matrix.config.cmake }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Update pip and setup venv - run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo "PATH=$PATH" >> $GITHUB_ENV - - name: Clone w/ submodules - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Install Python packages - run: python -m pip install -r doc/requirements.txt -U - - name: Build Arbor Docs - run: | - mkdir build - cd build - cmake .. -DARB_WITH_PYTHON=ON -DPython3_EXECUTABLE=`which python` -DARB_USE_BUNDLED_LIBS=ON - make html - diff --git a/.github/workflows/test-pip.yaml b/.github/workflows/test-pip.yaml new file mode 100644 index 0000000000..f65f1ca08d --- /dev/null +++ b/.github/workflows/test-pip.yaml @@ -0,0 +1,44 @@ +name: Test pip + +on: + push: + branches: [ master ] + paths-ignore: 'doc/**' + pull_request: + branches: [ master ] + paths-ignore: 'doc/**' + +jobs: + testpip: + name: "Pip build test + Python examples test" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04] + python-version: [3.7] + steps: + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Clone w/ submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Update pip and setup venv + run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo PATH=$PATH >> $GITHUB_ENV + - name: Debug info Python + run: | + which python + python --version + pip --version + - name: Build and install Arbor using pip + build flags + run: CMAKE_ARGS="-DARB_VECTORIZE=ON -DARB_ARCH=native" pip install . --user + - name: Check that build flags match + run: | + python -c "import arbor; print(arbor.config())" | grep -q "'arch': 'native'" + - name: Run Python tests + run: python -m unittest discover -v -s python + - name: Run Python examples + run: scripts/run_python_examples.sh + - name: Test executables + run: scripts/test_executables.sh diff --git a/.github/workflows/spack.yml b/.github/workflows/test-spack.yml similarity index 95% rename from .github/workflows/spack.yml rename to .github/workflows/test-spack.yml index bd5ed162d0..f9978bda1e 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/test-spack.yml @@ -3,8 +3,10 @@ name: Spack on: push: branches: [ master ] + paths-ignore: 'doc/**' pull_request: branches: [ master ] + paths-ignore: 'doc/**' jobs: build: diff --git a/README.md b/README.md index fe29e5f908..955b07554a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -[![ci](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml) -[![pythonwheels](https://github.com/arbor-sim/arbor/actions/workflows/release.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/release.yml) +[![ci](https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml) +[![spack](https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml) +[![pip](https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml) +[![pythonwheels](https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml) [![gitpod](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/arbor-sim/arbor) [![docs](https://readthedocs.org/projects/arbor/badge/?version=latest)](https://docs.arbor-sim.org/en/latest/) [![gitter](https://badges.gitter.im/arbor-sim/community.svg)](https://gitter.im/arbor-sim/community) diff --git a/doc/index.rst b/doc/index.rst index 2bdc207244..f1032a29e8 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,13 +1,19 @@ Arbor ===== -|ci| |pythonwheels| |zlatest| |gitter| |matrix| +|ci| |spack| |pip| |pythonwheels| |zlatest| |gitter| |matrix| -.. |ci| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg - :target: https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml +.. |ci| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml/badge.svg + :target: https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml -.. |pythonwheels| image:: https://github.com/arbor-sim/arbor/actions/workflows/release.yml/badge.svg - :target: https://github.com/arbor-sim/arbor/actions/workflows/release.yml +.. |spack| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml/badge.svg + :target: https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml + +.. |pip| image:: https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml/badge.svg + :target: https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml + +.. |pythonwheels| image:: https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml/badge.svg + :target: https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml .. |gitter| image:: https://badges.gitter.im/arbor-sim/community.svg :target: https://gitter.im/arbor-sim/community diff --git a/pyproject.toml b/pyproject.toml index 7de88c9d18..a98bf0db40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,11 +61,10 @@ build-backend = "scikit_build_core.build" [tool.cibuildwheel] build-frontend = "build" -build = ["cp3*-*linux*","cp3*-macosx*"] -skip = ["cp36*", "pp*", "*musllinux*"] +build = ["*linux*","*macosx*"] +skip = ["cp36*", "*musllinux*"] test-command = "python -m unittest discover -v -s {project}/python" -before-build = "python -m pip install pip --upgrade" -before-test = "python -m pip install pip --upgrade" +dependency-versions = "latest" [tool.cibuildwheel.macos] archs = ["universal2"]