From be739c319f30e9052c16358a6efae2a6ee42cbf0 Mon Sep 17 00:00:00 2001 From: Niklas Ye Date: Fri, 31 Jul 2026 07:28:51 +0200 Subject: [PATCH] Check every push and pull request The release workflow gates a tag, which is the last possible moment: a commit that breaks the suite stayed green on main until somebody decided to publish, and then failed the release instead of the change that caused it. A CI workflow now runs go vet and go test on pushes to main and on pull requests. push is scoped to main rather than left open. A branch pushed as part of a pull request would otherwise be checked twice, and gh-pages carries the published chart index with no Go code in it, so go vet there would fail on a missing go.mod. Runs for the same ref cancel each other, since a rapid series of pushes only needs the last one checked. --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 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..e330ec0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +# The release workflow gates a tag, which is late: a broken commit sits green +# until somebody decides to publish. This runs the same checks on the way in. +# +# push is scoped to main rather than all branches for two reasons: a branch +# pushed as part of a pull request would otherwise be checked twice, and +# gh-pages holds the published Helm chart index with no Go code in it, so +# `go vet ./...` there would fail on a missing go.mod. +on: + push: + branches: [main] + pull_request: + +# A rapid series of pushes only needs the last one checked. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Vet + run: go vet ./... + + - name: Test + run: go test ./...