Problem
.github/workflows/ci.yml defines three jobs (test, vuln, lint) inline. If a sister repo or fork wants the same setup, they re-implement it. A reusable workflow makes the surface composable.
Proposal
Split ci.yml into:
.github/workflows/_test.yml — reusable, takes os and go-version inputs, runs the test job.
.github/workflows/_lint.yml — reusable, runs lint + govulncheck.
.github/workflows/ci.yml — top-level, calls the reusable workflows for the matrix.
Pattern (per GitHub docs):
# ci.yml
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: ['1.25', '1.26']
uses: ./.github/workflows/_test.yml
with:
os: ${{ matrix.os }}
go-version: ${{ matrix.go }}
Acceptance criteria
- Existing 3-job structure preserved (test matrix, vuln, lint all run).
- Reusable workflows callable from sister repos via
uses: neverDefined/go-anvil/.github/workflows/_test.yml@v0.2.0.
- Document the call signature in CONTRIBUTING.md.
Out of scope
Don't migrate to a third-party action like nektos/act or similar. Stay on stock GitHub Actions.
Problem
.github/workflows/ci.ymldefines three jobs (test, vuln, lint) inline. If a sister repo or fork wants the same setup, they re-implement it. A reusable workflow makes the surface composable.Proposal
Split
ci.ymlinto:.github/workflows/_test.yml— reusable, takesosandgo-versioninputs, runs the test job..github/workflows/_lint.yml— reusable, runs lint + govulncheck..github/workflows/ci.yml— top-level, calls the reusable workflows for the matrix.Pattern (per GitHub docs):
Acceptance criteria
uses: neverDefined/go-anvil/.github/workflows/_test.yml@v0.2.0.Out of scope
Don't migrate to a third-party action like
nektos/actor similar. Stay on stock GitHub Actions.