/golang-ci-template-github-actions

example for golang project using github actions

Primary LanguageGoMIT LicenseMIT

golang ci template using github actions

Build Status Coverage Status Go Report Card

Info

This repository serves as a template for github-actions integrated go projects. It consists of a hello, world! like example in source file main.go which gets compiled into binary golang-ci-template-github-actions. The CI runs some linters on the code, before the unit tests are executed. When the build stage was successful, build artifacts are uploaded and available in the CI job status.

For demonstration purposes, a linux, macos and windows target are created and packetized in a zip-archive.

Creating a release

On your repositories home (github.com) go to Releases > create release. When a new release is created, the released-artifacts are automatically uploaded to github and available on the releases page

Test coverage (coveralls)

We use the gcov2lcov-action to first convert the golang test coverage to lcov format and then upload it using the coveralls github action.

Don't forget to enable Leave comments (x) in coveralls, under repo settings > pull request alerts, so that the coveralls-action posts a comment with the test coverage to affected pull requests:

pr screenshot

Author

Jan Delgado