https://github.com/baalimago/simple-go-pipeline
The simple go pipeline provides modular validation, test-coverage and releases.
https://github.com/baalimago/simple-go-pipeline
github-actions golang pipeline
Last synced: 3 months ago
JSON representation
The simple go pipeline provides modular validation, test-coverage and releases.
- Host: GitHub
- URL: https://github.com/baalimago/simple-go-pipeline
- Owner: baalimago
- License: mit
- Created: 2023-12-23T09:14:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-11T19:08:56.000Z (5 months ago)
- Last Synced: 2025-05-11T20:19:51.175Z (5 months ago)
- Topics: github-actions, golang, pipeline
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Go Pipeline
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](https://github.com/baalimago/percentaverage/actions/runs/7308650137)
- Test coverage printout:
By default, it:
- Builds the application
- Checks that the code is adheres to [staticcheck](https://staticcheck.dev/) linting
- Checks that the code is formated with [gofumpt](https://github.com/mvdan/gofumpt)
- Tests with `-race` flagOn exit code or similar failures, the pipeline will fail.
## Usage
Create a file `/.github/workflows/go.yml` with this in it:```yaml
name: Simple Go Pipelineon:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]jobs:
call-workflow:
uses: baalimago/simple-go-pipeline/.github/workflows/go.yml@v0.2.8
with:
test-readme-coverage: false
```Done!
[See here](https://github.com/baalimago/simple-go-pipeline/blob/main/.github/workflows/go.yml) 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.## Test coverage readme
In order to get test coverage updated automatically updated into your readme, do like this:
1. __Carefully review your Gitlab Actions workflows, including this repo..!__
1. Go to `https://github.com///settings/actions`
1. Set `Workflow Permissions` to `Read and write perimssions`
1. Hit save
1. Somewhere within your `README.md`, add the line `Test coverage:`
1. Remove `test-readme-coverage: false` from your `go.yml` github actions workflow specification (it's true by default)