Skip to content

Commit

Permalink
chore: update Go build workflow and Makefile, improve CI
Browse files Browse the repository at this point in the history
  • Loading branch information
edmarfelipe committed Aug 25, 2024
1 parent 3e57804 commit 3c639c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Continuous Integration

env:
GO_VERSION: "1.23"
Expand Down Expand Up @@ -59,6 +59,14 @@ jobs:
name: code-coverage
path: coverage.txt

- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: coverage.txt
threshold-file: 0
threshold-package: 0
threshold-total: 30

coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ lint:
golangci-lint run ./...

test:
go test -race -coverprofile=coverage.txt ./...
go test -covermode=atomic -race -coverprofile=coverage.txt ./...

13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# go-ci
# Golang CI/CD with Github Actions

[![coverage](https://raw.githubusercontent.com/edmarfelipe/go-ci/badges/.badges/main/coverage.svg)](/.github/.testcoverage.yml)

This repository is a simple example of how to use Github Actions to build and test a Golang application.

## Features

- Build with Cache to speed up the process
- Run tests with coverage
- Push code coverage to PR comments
- Push linting errors to PR code review

0 comments on commit 3c639c5

Please sign in to comment.