Opinionated GitHub Actions and reusable workflows for Go projects, following the conventions of ci-github-nodejs and ci-github-php.
A Go module with committed go.mod and go.sum when dependencies require it.
The default tests need a Linux runner with CGO and a C compiler.
Use GitHub.com and a Linux Actions runner supporting Node.js 24 actions and
same-repository $/ references.
name: CI
on: [push, pull_request]
permissions: {}
jobs:
go:
uses: hoverkraft-tech/ci-github-go/.github/workflows/continuous-integration.yml@main
permissions:
contents: read
id-token: writeThe workflow detects the project's runtime. Pin the workflow to a reviewed
commit SHA in production. The reusable workflow declares OIDC permission for
optional Codecov uploads, so callers must grant id-token: write; standalone
actions with GitHub reporting require only contents: read.
| Action | Purpose |
|---|---|
| setup-go | Install the project runtime and dependencies |
| lint | Check style and static analysis |
| test | Run tests and retain native reports |
| audit | Check dependency vulnerabilities |
| build | Compile packages or project binaries |