From 8a3848bcfaa4fe2c856179e65a0dc26197fa3f6b Mon Sep 17 00:00:00 2001 From: ruscher Date: Fri, 9 Oct 2026 00:02:01 -0300 Subject: [PATCH] ci: one run per push or pull request Each push and pull request started two workflows, Backend tests and Build Package (or Package check), so the Actions list showed every event twice, and a merge to main repeated as two more runs what its pull request had just run. backend-tests.yml now runs only when called (or by hand). build-package.yml calls it as a job beside the package, so a push is one "Build Package" run and a pull request one "Package check" run, each with the code's checks and the package in parallel. A Build Package run, the one the BigLinux builders act on, now succeeds only when the code's checks pass too. --- .github/workflows/backend-tests.yml | 17 ++++++---------- .github/workflows/build-package.yml | 9 ++++++++- .github/workflows/package-check.yml | 11 ++++++----- README.md | 30 +++++++++++++++-------------- docs/ci-workflows-audit.md | 30 +++++++++++++++++------------ 5 files changed, 54 insertions(+), 43 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 4c7995f..50cfc69 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -1,24 +1,19 @@ name: Backend tests # The code: formatting, Clippy, the workspace's tests, rustdoc links, the -# privileged helper's authorization refusals and the translations. The -# package itself is build-package.yml's. See docs/ci-workflows-audit.md. +# privileged helper's authorization refusals and the translations. +# +# Not run on its own for pushes or pull requests: build-package.yml calls it +# beside the package, so each push or pull request is one run with both +# jobs (see docs/ci-workflows-audit.md). A manual run checks any branch. on: - pull_request: - push: - branches: [main] + workflow_call: workflow_dispatch: permissions: contents: read -concurrency: - group: backend-tests-${{ github.ref }} - # A newer commit on a pull request makes the older run moot; every commit - # on main keeps its own result. - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - jobs: rust: name: Rust workspace, helper authorization and translations diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index 02df064..fa500ed 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -1,7 +1,9 @@ name: Build Package # Builds the commit under test with pkgbuild/PKGBUILD, in Arch's own -# container, validates the package and keeps it as an artifact. +# container, validates the package and keeps it as an artifact. Beside it, +# backend-tests.yml checks the code: one run per push or pull request, with +# both jobs. # # This workflow's success is what the BigLinux package builders act on: when # a "Build Package" run of biglinux/bigamemode ends in success, they build @@ -33,6 +35,11 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + # The code's checks, in parallel with the package. A run is successful, + # and so handed to the BigLinux builders, only when both pass. + rust: + uses: ./.github/workflows/backend-tests.yml + package: name: Build and validate the Arch package runs-on: ubuntu-24.04 diff --git a/.github/workflows/package-check.yml b/.github/workflows/package-check.yml index abaa5d3..9935578 100644 --- a/.github/workflows/package-check.yml +++ b/.github/workflows/package-check.yml @@ -1,9 +1,10 @@ name: Package check -# The package build and every check of build-package.yml, for pull requests -# and manual runs of any branch. Under this name a successful run is not -# handed to the BigLinux package builders, which act on "Build Package" -# runs only (see build-package.yml). See docs/ci-workflows-audit.md. +# Everything build-package.yml runs (the code's checks of backend-tests.yml +# and the package), for pull requests and manual runs of any branch, as one +# run. Under this name a successful run is not handed to the BigLinux package +# builders, which act on "Build Package" runs only (see build-package.yml). +# See docs/ci-workflows-audit.md. on: pull_request: @@ -13,5 +14,5 @@ permissions: contents: read jobs: - package: + check: uses: ./.github/workflows/build-package.yml diff --git a/README.md b/README.md index 82f205e..7451868 100644 --- a/README.md +++ b/README.md @@ -470,20 +470,22 @@ BIGAME_LOCALEDIR=/tmp/bgm-locale LANGUAGE=pt_BR bigame-engine/target/debug/bigam template, compiles the catalogues and runs `cargo test --release --frozen --workspace` in `check()`. -Two workflows check every pull request (details in -[`docs/ci-workflows-audit.md`](docs/ci-workflows-audit.md)): - -- `.github/workflows/backend-tests.yml`, also on every push to `main`: - formatting, Clippy with warnings as errors, the tests, `cargo doc` with - warnings as errors, the helper's authorization test as an ordinary user, the - translation template and catalogues. -- `.github/workflows/build-package.yml`, also on every push to `main`, - `testing-*` and `stable-*`: a `makepkg` build of that very commit with - `pkgbuild/PKGBUILD`, checked with namcap, `desktop-file-validate`, - `appstreamcli` and a look at every file it installs; the package is kept as - an artifact. A successful run of it is what the BigLinux package builders - build. Pull requests run the same build as `package-check.yml`, which is - not handed to them. +One run checks every pull request and every push (details in +[`docs/ci-workflows-audit.md`](docs/ci-workflows-audit.md)), with two jobs in +parallel: + +- the code (`.github/workflows/backend-tests.yml`): formatting, Clippy with + warnings as errors, the tests, `cargo doc` with warnings as errors, the + helper's authorization test as an ordinary user, the translation template + and catalogues; +- the package (`.github/workflows/build-package.yml`): a `makepkg` build of + that very commit with `pkgbuild/PKGBUILD`, checked with namcap, + `desktop-file-validate`, `appstreamcli` and a look at every file it + installs; the package is kept as an artifact. + +Pushes to `main`, `testing-*` and `stable-*` run as *Build Package*; a +successful one is what the BigLinux package builders build. Pull requests run +as *Package check*, which is not handed to them. ## Author diff --git a/docs/ci-workflows-audit.md b/docs/ci-workflows-audit.md index aca7c87..ff6c3bd 100644 --- a/docs/ci-workflows-audit.md +++ b/docs/ci-workflows-audit.md @@ -56,20 +56,26 @@ outside CI is the test above, in `bigame-core/src/graphics/optiscaler.rs`. ## Final architecture ```text -pull_request ─┬─► backend-tests ─── rust: fmt · clippy · test · doc · authorization · translations -push main ────┤ - │ - └─► package-check ──┐ - │ workflow_call -push main, ▼ -testing-*, stable-* ──► build-package ─── package: prepare source of $GITHUB_SHA → makepkg -s - → identify → metadata → contents → desktop - → AppStream → namcap → SHA256SUMS → artifact - │ - └─ a successful "Build Package" run: the BigLinux - builders build its branch +pull_request ──► "Package check" (package-check.yml) ─┐ + │ workflow_call +push main, ▼ +testing-*, stable-* ──► "Build Package" (build-package.yml) + ├─ rust (backend-tests.yml, workflow_call): + │ fmt · clippy · test · doc · authorization · translations + └─ package: prepare source of $GITHUB_SHA → makepkg -s + → identify → metadata → contents → desktop + → AppStream → namcap → SHA256SUMS → artifact + +A successful "Build Package" run (both jobs): the BigLinux builders build +its branch. ``` +One run per push or pull request, with both jobs in parallel. Until +2026-10-09 the code's checks were a workflow of their own, so every push +and pull request showed two runs, and a push to `main` repeated, as two more +runs, what its pull request had just run. `backend-tests.yml` now only runs +when called (or by hand). + ## How the BigLinux builders are triggered The BigLinux builders (GitLab, `gitlab.bigib.org/builder/packagebuilder`)