Repository navigation
ci: roda go build, vet e test nos pull requests para a develop - #209
Merged
Merged
Conversation
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ijukEy5wKHnKg7NemEPk9
Reviewer's GuideImplementa CI automatizado para a branch develop, cobrindo build, vet e testes Go; o checkout inclui submódulos e o toolchain é derivado do go.mod, com execução otimizada por cancelamento de runs concorrentes. Sequence diagram for the develop CI workflowsequenceDiagram
participant GitHub
participant CI as CI Workflow
participant Runner as Ubuntu Runner
participant Go as Go Toolchain
GitHub->>CI: pull_request to develop
GitHub->>CI: push to develop
CI->>CI: Cancel previous run for ci-${github.ref}
CI->>Runner: actions/checkout@v4 with recursive submodules
Runner->>Go: actions/setup-go@v5 using go.mod
Go-->>Runner: Configured toolchain
Runner->>Go: go build ./...
Runner->>Go: go vet ./...
Runner->>Go: go test ./...
Go-->>CI: Job success or failure
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
10 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descrição
Reabre o #198 a partir de uma branch do repositório da organização, com o mesmo commit (
273383c), para que a mudança não dependa de um fork. O conteúdo não mudou: a discussão completa e as medições continuam no #198.Adiciona
.github/workflows/ci.yml, que rodago build ./...,go vet ./...ego test ./...em todo pull request com basedevelop(e em push nadevelop).Hoje nenhum workflow do repositório dispara em
pull_request: nenhum pull request é compilado por automação antes da revisão.Por que
go vet, e não sógo build. Ogo buildnunca compila arquivos_test.go. Medido nadevelop@706c9a4, com um arquivo de teste importando um caminho que não resolve:go build ./...sai com 0,go vet ./...ego test ./...saem com 1. Oveté o passo que pega o erro mais comum em contribuição externa.Por que só
develop.developemainnão têm ancestral comum neste repositório, então um workflow adicionado nadevelopnunca existiria namain. Por isso este workflow cobre só os pull requests com basedevelop.Card relacionado
CRM-405
Tipo de mudança
Testes
_test.goquebrado,vetetestreprovam ebuildpassa; sem ele, os três passam (1 pacote com teste, 50 sem, 0 falhas).develop@706c9a4o job nasce verde, sem dívida herdada.event=pull_request,conclusion=success, no commit273383c. O build com cgo/libwebp funciona noubuntu-latestsemapt-get, e osetup-goresolve o toolchain pelogo.mod.Fora de escopo, de propósito
gofmt: há 8 arquivos fora do padrão nadevelophoje; o check entra depois que eles forem formatados.make check(o alvofmtreescreve arquivos) emake lint(golangci-lintnão está instalado e não há.golangci.yml).CGO_ENABLEDexplícito eactions/cachemanual.Depois do merge
O check
goserá marcado como obrigatório nadevelop. Sem isso, um run vermelho não bloqueia nada.Summary by Sourcery
CI: