From 273383c243877f555c83749be11289d368c145e2 Mon Sep 17 00:00:00 2001 From: Matheus Pastorini Date: Tue, 15 Sep 2026 01:55:42 -0300 Subject: [PATCH] ci: run go build, vet and test on pull requests to develop No workflow in this repository is triggered by pull_request, so no PR is compiled by automation before review. The only Go check in the pipeline is `go build ./cmd/evolution-go/` inside sync-releases.yml, which runs after the fact, on the generated output, and does not cover pkg/telemetry, tools/build-dist or tools/encode-url. `go build` is not a sufficient gate: it never compiles _test.go files. Measured on develop with a test file importing a module path that does not resolve, `go build ./...` exits 0 while `go vet ./...` and `go test ./...` exit 1. vet is the step that catches the most common class of error in outside contributions. Pinned to develop only: develop and main have no common ancestor, so a workflow added here would never exist on main and pull_request would not fire for it there. setup-go reads go-version-file: go.mod rather than a literal version, so the toolchain cannot drift from what the module declares. Baseline on develop @706c9a4 with the submodule at its pinned SHA: build, vet and test all exit 0 (1 package with tests, 50 without, 0 failures), so this starts green. Deliberately out of scope: gofmt (8 files are currently unformatted, one of them pkg/whatsmeow/service/whatsmeow.go), make check (its fmt target rewrites files), make lint (golangci-lint is not installed and no .golangci.yml exists) and golangci-lint itself. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_017ijukEy5wKHnKg7NemEPk9 --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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 000000000..bdf4a16fe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + pull_request: + branches: [develop] + push: + branches: [develop] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + go: + runs-on: ubuntu-latest + steps: + # go.mod replaces go.mau.fi/whatsmeow with ./whatsmeow-lib, so the + # submodule must be present or the build cannot resolve the module. + - uses: actions/checkout@v4 + with: + submodules: recursive + + # go.mod is the single source of truth for the toolchain version. + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - run: go build ./... + # go build never compiles _test.go files; vet does. This is the real gate. + - run: go vet ./... + - run: go test ./...