Skip to content

Commit

Permalink
ci: add test coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
davidramiro committed Feb 11, 2024
1 parent 618b449 commit d927232
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '>=1.20.0'
- name: Create config.yml from secrets
run: echo -n "${{ secrets.CONFIG_YML }}" | base64 --decode > config.yml
go-version: '>=1.22.0'
- name: Install mockery
run: go install github.com/vektra/mockery/v2@v2.40.3
- name: Generate mocks
run: mockery
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test -v ./...
run: go test ./... -coverprofile="cover.out" -covermode=atomic -coverpkg=./...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
6 changes: 1 addition & 5 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ packages:
github.com/davidramiro/frigabun/services:
interfaces:
ServiceFactory:
DnsUpdateService:
github.com/spf13/viper:
interfaces:
GetBool:
GetString:
DnsUpdateService:
10 changes: 10 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
profile: cover.out

threshold:
file: 70
package: 80
total: 95

exclude:
paths:
- mocks

0 comments on commit d927232

Please sign in to comment.