{"id":16623672,"url":"https://github.com/jandelgado/golang-ci-template-github-actions","last_synced_at":"2025-04-07T14:13:18.922Z","repository":{"id":39902879,"uuid":"211722342","full_name":"jandelgado/golang-ci-template-github-actions","owner":"jandelgado","description":"example for golang project using github actions","archived":false,"fork":false,"pushed_at":"2025-03-31T08:54:53.000Z","size":1145,"stargazers_count":58,"open_issues_count":4,"forks_count":41,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:07:30.974Z","etag":null,"topics":["ci","coverage","coveralls","docker","github-actions","golang","goreleaser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jandelgado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-29T20:31:18.000Z","updated_at":"2025-03-31T04:59:39.000Z","dependencies_parsed_at":"2024-06-20T05:48:46.977Z","dependency_job_id":"3df6f0d6-a827-49a6-89ee-f701ab2d9b16","html_url":"https://github.com/jandelgado/golang-ci-template-github-actions","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fgolang-ci-template-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fgolang-ci-template-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fgolang-ci-template-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fgolang-ci-template-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jandelgado","download_url":"https://codeload.github.com/jandelgado/golang-ci-template-github-actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666014,"owners_count":20975788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","coverage","coveralls","docker","github-actions","golang","goreleaser"],"created_at":"2024-10-12T03:24:33.566Z","updated_at":"2025-04-07T14:13:18.895Z","avatar_url":"https://github.com/jandelgado.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golang ci template using github actions\n\n[![Build Status](https://github.com/jandelgado/golang-ci-template-github-actions/workflows/run%20tests/badge.svg)](https://github.com/jandelgado/golang-ci-template-github-actions/actions?workflow=run%20tests)\n[![Coverage Status](https://coveralls.io/repos/github/jandelgado/golang-ci-template-github-actions/badge.svg?branch=master)](https://coveralls.io/github/jandelgado/golang-ci-template-github-actions?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jandelgado/golang-ci-template-github-actions)](https://goreportcard.com/report/github.com/jandelgado/golang-ci-template-github-actions)\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Info](#info)\n* [Go-Version](#go-version)\n* [Dependabot](#dependabot)\n* [Creating a release](#creating-a-release)\n* [Linting \u0026 Test](#linting--test)\n    * [Linter](#linter)\n    * [Test](#test)\n* [Author](#author)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Info\n\nThis repository serves as a template for github-actions integrated go projects.\nIt consists of a `hello, world!` like example in source file [main.go](main.go)\nwhich gets compiled into the binary `my-app` using goreleaser. The CI is\nconfigured to run\n[golangci-linter](https://github.com/golangci/golangci-lint-action) on the code,\nbefore the unit tests are executed. Test coverage is uploaded to coveralls.io.\n\n[goreleaser](https://github.com/goreleaser/goreleaser) is used to create the\nfinal multi-plattform assets, which are automatically uploaded to the\n[release](https://github.com/jandelgado/golang-ci-template-github-actions/releases/latest).\nThe [release-process](#creating-a-release) is triggered by pushing a git tag to\nthe repository.\n\nFinally, a docker image is built, which gets published to\n[ghcr.io](https://github.com/jandelgado/golang-ci-template-github-actions/pkgs/container/my-app).\nRun it with\n\n```console\n$ docker run --rm  ghcr.io/jandelgado/my-app:latest\nhello, world!\n```\n\n## Go-Version\n\nThe go version to use is configured in `go.mod` with the `toolchain` directive.\nWhen building locally, set `GOTOOLCHAIN` to `auto` to automatically install\nthe configured toolchain (introduced with go 1.21).\n\n## Dependabot\n\nWe use [dependabot](https://docs.github.com/en/code-security/dependabot) to\nboth keep the go dependencies as well as the used github action up-to-date.\nThe configuration can be found [here](.github/dependabot.yml).\n\n## Creating a release\n\nA new release is created by creating a git tag and pushing it, e.g.:\n\n```console\n$ git tag -a \"v1.2.3\" -m \"this is release v1.2.3\"\n$ git push origin v1.2.3\n```\n\nThe push of the new tag triggers the CI, which uses goreleaser with\n [this configuration](.goreleaser.yml) to\n\n* build multi-platform release artifacts\n* create a new release\n* upload the artifacts, which are then available on the [releases page](/jandelgado/golang-ci-template-github-actions/releases).\n\nFinally, a docker image is built using the previously built artefacts. The image\nis published to\n[ghcr.io](https://github.com/jandelgado/golang-ci-template-github-actions/pkgs/container/golang-ci-template-github-actions).\n\nTo run goreleaser locally, start the tool with `gorelaser build --snapshot --clean`.\n\n## Linting \u0026 Test\n\n### Linter\n\n[golangci-linter](https://github.com/golangci/golangci-lint-action) is\nconfigured for code-linting. The report is uploaded so that linting results\nare visible in the MR:\n\n![pr screenshot](images/linter.png)\n\n### Test\n\nWe use the\n[coveralls-github-action](https://github.com/coverallsapp/github-action) to\nupload the golang coverage to coveralls.\n\nDon't forget to enable `Leave comments (x)` in coveralls, under\n`repo settings` \u003e `pull request alerts`, so that the coveralls-action posts a comment\nwith the test coverage to affected pull requests:\n\n![pr screenshot](images/pr.png)\n\n## Author\n\n(c) copyright 2021-2025 by Jan Delgado, License MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fgolang-ci-template-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjandelgado%2Fgolang-ci-template-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fgolang-ci-template-github-actions/lists"}