From 574646824250d3bd68d64341531bbfe85aadc152 Mon Sep 17 00:00:00 2001 From: Bart Van Bos Date: Sat, 14 Nov 2026 04:44:29 +0100 Subject: [PATCH] ci: policy 1.6, shared workflows v3.8.0 and the PR workflow Co-Authored-By: Claude Fable 5.2 --- .github/workflows/ci.yml | 15 ++++++------ .github/workflows/docs.yml | 11 +++++---- .github/workflows/pr.yml | 46 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 2 +- .otfabric/policy.yaml | 2 +- AGENTS.md | 2 +- CONTRIBUTING.md | 11 +++++++++ 7 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5364998..1c8e140 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,11 @@ +# Called by pr.yml on every pull request that is not documentation only; +# dispatch it to run it on a branch without a pull request. name: CI run-name: "CI (${{ github.event_name }}) on ${{ github.ref_name }} by @${{ github.actor }}" on: - push: - branches: ["**"] - paths-ignore: ["**/*.md"] - pull_request: - branches: ["**"] - paths-ignore: ["**/*.md"] + workflow_call: + workflow_dispatch: permissions: contents: read @@ -15,8 +13,10 @@ permissions: jobs: ci: - uses: otfabric/.github/.github/workflows/go-ci.yml@v3.3.1 + uses: otfabric/.github/.github/workflows/go-ci.yml@v3.8.0 with: + # otfabric-policy runs in docs.yml, on every pull request and push to main. + run-policy: false run-govulncheck: true fuzz-time: 10s coverage-min: "85" @@ -26,7 +26,6 @@ jobs: # coverage across the whole module, matching `make coverage`. test-exclude-regex: "/example(s)?($|/)" coverpkg: ./... - policy-version: v1.4.2 secrets: inherit # The shared workflow gates the total; this job gates each package. diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 702eca7..f1fe0e5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,19 +1,20 @@ # Documents against the code (DOC-008, standards/documentation.md#doc-sync). -# No path filter: this is the check that runs when ci.yml skips a -# Markdown-only change, so branch protection can require it. +# pr.yml calls it on every pull request; on main it runs on every push, with +# no path filter. name: Docs on: push: branches: [main] - pull_request: + workflow_call: + workflow_dispatch: permissions: contents: read jobs: docs: - uses: otfabric/.github/.github/workflows/docs-check.yml@v3.5.0 + uses: otfabric/.github/.github/workflows/docs-check.yml@v3.8.0 with: docsync-version: v0.3.1 - policy-version: v1.4.2 + policy-version: v1.6.1 secrets: inherit diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..1137909 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,46 @@ +# The pull request gate (otfabric/.github PR workflow), generated by +# otfabric/.github scripts/rollout/pr-workflow.py. No path filter: the light +# checks always run, the heavy ones unless the change is documentation only, +# then "OT Fabric Required Checks", the only check a ruleset requires. +name: PR +on: + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + changes: + uses: otfabric/.github/.github/workflows/pr-changes.yml@v3.8.0 + + ci: + needs: changes + if: needs.changes.outputs.full == 'true' + permissions: + contents: read + id-token: write + uses: ./.github/workflows/ci.yml + secrets: inherit + + docs: + permissions: + contents: read + uses: ./.github/workflows/docs.yml + secrets: inherit + + required: + name: OT Fabric Required Checks + needs: [changes, docs, ci] + if: always() + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: otfabric/.github/actions/required-gate@v3.8.0 + with: + needs: ${{ toJSON(needs) }} + required: changes docs + required-for-code: ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c31dae8..aebbe56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ permissions: jobs: release-bacnetctl-binary: - uses: otfabric/.github/.github/workflows/go-binary-release.yml@v3.6.0 + uses: otfabric/.github/.github/workflows/go-binary-release.yml@v3.8.0 with: bump: ${{ inputs.bump }} binary-name: bacnetctl diff --git a/.otfabric/policy.yaml b/.otfabric/policy.yaml index f9c7aa3..4f623bd 100644 --- a/.otfabric/policy.yaml +++ b/.otfabric/policy.yaml @@ -1,5 +1,5 @@ # OT Fabric engineering policy adoption (otfabric/engineering standards/README.md#adoption). -policy: "1.4" +policy: "1.6" profile: cli mode: enforce owner: bartvanbos diff --git a/AGENTS.md b/AGENTS.md index f384f8d..4df48ea 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ Command-line client for BACnet/IP built on [go-bacnet](https://github.com/otfabr ## Organisation standards -This repository follows **otfabric/engineering policy 1.4**, profile **cli** (`.otfabric/policy.yaml`, mode `enforce`). Where this file and the organisation standards disagree, this file wins here — say so in your report. +This repository follows **otfabric/engineering policy 1.6**, profile **cli** (`.otfabric/policy.yaml`, mode `enforce`). Where this file and the organisation standards disagree, this file wins here — say so in your report. ## Where the truth lives diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89f952b..7d7f9dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -133,3 +133,14 @@ docs/ Exit codes, JSON output contract ## License By contributing to `bacnetctl`, you agree that your contributions will be licensed under the [MIT License](LICENSE). + +## When CI runs + +| Event | Workflow | What runs | +|---|---|---| +| Pull request | `pr.yml` | `docs.yml` (docsync, otfabric-policy) always; `ci.yml` unless every changed file is documentation; then `OT Fabric Required Checks` | +| Push to a branch | none | nothing; dispatch `ci.yml` to test a branch without a pull request | +| Push to `main` | `docs.yml` | the light checks; the merged commit was tested as the pull request's merge commit | +| Release | `release.yml` | the release workflow tests the release commit again | + +Documentation means an added or modified `*.md` file outside `.github/`, `testdata/` and `vendor/`, other than `AGENTS.md` and `CLAUDE.md`. A deleted or renamed document, or any other file, runs everything. `OT Fabric Required Checks` fails unless every job that applies succeeded; its summary lists them.