From b2f7fc931e3393dfc047f7812ea58812cf431fbb Mon Sep 17 00:00:00 2001 From: Alexander Blech Date: Tue, 10 Nov 2026 02:45:47 +0100 Subject: [PATCH] Add CI workflow for tests and docs Tests on Linux (Python 3.14) and Windows (3.13), docs build, and a Pass job to require for merging. Runs on pull requests, pushes to main and weekly. Read-only permissions, actions pinned by commit SHA. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 91 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6f927f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,91 @@ +# OpenQuad - open database for multi-dimensional numerical integration +# SPDX-FileCopyrightText: 2026 Alexander Blech +# SPDX-License-Identifier: MPL-2.0 + +# Tests and docs build on every pull request, on pushes to main, and weekly. +# Dependencies are resolved fresh on each run, so a new library release can turn +# CI red with no change here. The weekly run is there to catch exactly that. + +name: CI + +on: + pull_request: + push: + branches: [main] + schedule: + - cron: "17 5 * * 1" # Mondays, 05:17 UTC + +permissions: + contents: read + +# A new push to a pull request cancels its older, unfinished run. Runs on main +# are never cancelled, so every commit there gets a full result. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +env: + FORCE_COLOR: "1" + PIP_DISABLE_PIP_VERSION_CHECK: "1" + +jobs: + tests: + name: Tests (${{ matrix.os }}, Python ${{ matrix.python }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + python: "3.14" + - os: windows-latest + python: "3.13" + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: ${{ matrix.python }} + # A regular, non-editable install, so the tests use the package as users + # get it, including its data files. `--group` needs pip 25.1 or newer. + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install . --group test + - name: Show versions + run: python -m pip list + - name: Run tests + run: python -m pytest + + docs: + name: Docs + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: "3.13" + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install . --group docs + # Warnings do not fail the build yet; the known ones are content issues. + - name: Build + run: python -m sphinx -b html doc doc/_build/html -d doc/_build/doctree + + # The single check to require for merging: green only if all jobs above are. + pass: + name: Pass + if: always() + needs: [tests, docs] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0 + with: + jobs: ${{ toJSON(needs) }}