From 395afb56fe7a50e1f0c924ce18f6ad6a5776ea52 Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Thu, 1 Oct 2026 10:53:19 +0100 Subject: [PATCH] ci: Modernise testing and add release automation Use current GAP actions for cross-version testing, manual builds, and manually triggered package releases with website updates. Assisted-by: Codex (GPT-6) --- .github/workflows/CI.yml | 73 +++++++++++++++++++---------------- .github/workflows/docs.yml | 44 +++++++++++++++++++++ .github/workflows/release.yml | 57 +++++++++++++++++++++++++++ README.md | 13 +++++++ 4 files changed, 153 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 42e79eb..5472c91 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,51 +1,56 @@ name: CI -# Trigger the workflow on push or pull request on: workflow_dispatch: - pull_request: push: + branches: [master, main] + pull_request: + +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_name != github.event.repository.default_branch || github.run_number }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - # The CI test job test: - name: GAP ${{ matrix.gap-branch }} - runs-on: ubuntu-latest - # Don't run this twice on PRs for branches pushed to the same repository - if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} + name: GAP ${{ matrix.gap-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: - gap-branch: - - master - - stable-4.14 - - stable-4.13 + os: [ubuntu] + gap-version: [devel, latest, minimal] + include: + - os: windows + gap-version: devel steps: - - uses: actions/checkout@v4 - - uses: gap-actions/setup-gap@v2 + - uses: actions/checkout@v6 + - uses: gap-actions/setup-cygwin@v2 + if: ${{ runner.os == 'Windows' }} + - uses: gap-actions/setup-gap@v3 with: - GAPBRANCH: ${{ matrix.gap-branch }} - GAP_PKGS_TO_CLONE: "datastructures ChrisJefferson/QuickCheck peal/BacktrackKit" - GAP_PKGS_TO_BUILD: "io profiling datastructures json digraphs orb grape" - - uses: gap-actions/run-pkg-tests@v2 - - uses: gap-actions/process-coverage@v2 - - uses: codecov/codecov-action@v5 + gap-version: ${{ matrix.gap-version }} + - uses: gap-actions/install-pkg@v1 with: - token: ${{ secrets.CODECOV_TOKEN }} - - # The documentation job - manual: - name: Build manuals - runs-on: ubuntu-latest - # Don't run this twice on PRs for branches pushed to the same repository - if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} - - steps: - - uses: actions/checkout@v4 - - uses: gap-actions/setup-gap@v2 + packages: | + ChrisJefferson/QuickCheck@devel + peal/BacktrackKit@devel + - uses: gap-actions/build-pkg@v3 + with: + extra-pkgs: quickcheck + - uses: gap-actions/run-pkg-tests@v4 with: - GAP_PKGS_TO_BUILD: '' - - uses: gap-actions/build-pkg-docs@v1 + coverage: ${{ runner.os != 'Windows' }} + - uses: gap-actions/run-pkg-tests@v4 with: - use-latex: 'true' + mode: onlyneeded + coverage: false + - uses: gap-actions/process-coverage@v3 + if: ${{ runner.os != 'Windows' }} + - uses: codecov/codecov-action@v6 + if: ${{ runner.os != 'Windows' }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: gap-coverage.json diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8a7ff9f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,44 @@ +name: Docs + +on: + workflow_dispatch: + push: + branches: [master, main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_name != github.event.repository.default_branch || github.run_number }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + manual: + name: Build manuals + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - uses: gap-actions/setup-gap@v3 + with: + gap-version: devel + - uses: gap-actions/install-pkg@v1 + with: + packages: peal/BacktrackKit@devel + - uses: gap-actions/build-pkg@v3 + with: + coverage: false + - name: Build BacktrackKit manual for cross-references + env: + NOPDF: '1' + run: | + cd "$GAPROOT/pkg/backtrackkit" + gap --quitonbreak makedoc.g + - uses: gap-actions/build-pkg-docs@v2 + with: + use-latex: true + - uses: actions/upload-artifact@v7 + with: + archive: false + path: doc/manual.pdf + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2114d6b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release + +on: + workflow_dispatch: + inputs: + dry-run: + description: Create release artifacts without publishing + type: boolean + default: false + force: + description: Allow replacing a release or using a different release date + type: boolean + default: false + +permissions: + contents: write + +concurrency: + group: release + cancel-in-progress: false + +jobs: + release: + name: Release the GAP package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - uses: gap-actions/setup-gap@v3 + with: + gap-version: devel + - uses: gap-actions/install-pkg@v1 + with: + packages: peal/BacktrackKit@devel + - uses: gap-actions/build-pkg@v3 + with: + coverage: false + - name: Build BacktrackKit manual for cross-references + env: + NOPDF: '1' + run: | + cd "$GAPROOT/pkg/backtrackkit" + gap --quitonbreak makedoc.g + - uses: gap-actions/build-pkg-docs@v2 + with: + use-latex: true + - name: Fix documentation links for distribution + run: bash .release + - uses: gap-actions/release-pkg@v1 + with: + dry-run: ${{ inputs.dry-run }} + force: ${{ inputs.force }} + - uses: gap-actions/update-gh-pages@v1 + if: ${{ !inputs.dry-run }} + with: + version: ${{ env.TAG }} + clean: false diff --git a/README.md b/README.md index 348afac..aef9d41 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,16 @@ This package is intended for learning and exploring the graph backtracking algor This package is a work in progress, both in terms of code and documentation. If you have any issues or questions about this package, please post an issue at https://github.com/peal/GraphBacktracking/issues + +## CI and releases + +CI tests the development, latest, and oldest supported GAP versions on Linux, +plus development GAP on Windows, with both normal and `OnlyNeeded` loading. +The Docs workflow builds the manual and uploads its PDF. + +To release, update the version and date in `PackageInfo.g`, push to `master`, +then run **Actions → Release** on `master` with **dry-run** selected first. +Inspect the generated archives and manuals, then rerun without dry-run to +publish the GitHub release and update the package website. Existing website +customisations are preserved. Use **force** only when intentionally replacing +an existing release or bypassing the release-date check.