The simple go pipeline provides modular validation and test-coverage.
It has minimal amounts of dependencies, is fully customizable and gives test coverage in README.md
without any third party websites.
Use it, or fork it and hack it!
Examples:
- Pipeline
- Test coverage printout:
By default, it:
- Builds the application
- Checks that the code is adheres to staticcheck linting
- Checks that the code is formated with gofumpt
- Tests with
-race
flag
On exit code or similar failures, the pipeline will fail.
Create a file <github-repo>/.github/workflows/go.yml
with this in it:
name: Simple Go Pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
call-workflow:
uses: baalimago/simple-go-pipeline/.github/workflows/go.yml@v0.1.3
with:
test-readme-coverage: false
Done!
See here for the input variables you should change to enable/disable the different aspects of the validation.
For example, jobs.call-workflow.with.staticcheck: false
(in proper yml indention), would disable the staticcheck.
In order to get test coverage updated automatically updated into your readme, do like this:
- Carefully review your Gitlab Actions workflows, including this repo..!
- Go to
https://github.com/<your-account>/<your-project>/settings/actions
- Set
Workflow Permissions
toRead and write perimssions
- Hit save
- Somewhere within your
README.md
, add the lineTest coverage:
- Remove
test-readme-coverage: false
from yourgo.yml
github actions workflow specification (it's true by default)