-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
K-Yo
committed
Oct 21, 2024
1 parent
6b85952
commit bceda66
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# workflow taken from https://github.com/marketplace/actions/go-coveragev | ||
name: "Go Coverage" | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
# It's important that the action also runs on merge to main | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# default fetch-depth is insufficent to find previous coverage notes | ||
fetch-depth: 10 | ||
|
||
- uses: gwatts/go-coverage-action@v2 | ||
id: coverage | ||
with: | ||
# Optional coverage threshold | ||
# use fail-coverage to determine what should happen below this threshold | ||
coverage-threshold: 80 | ||
|
||
# collect coverage for all packages beyond the one under test | ||
cover-pkg: ./... | ||
|
||
# Ignore code-generated files when calculating coverage totals | ||
ignore-pattern: | | ||
\.pb\.go$ | ||
\_string\.go$ | ||
# A url that the html report will be accessible at, once your | ||
# workflow uploads it. Used in the pull request comment. | ||
# report-url: https://artifacts.example.com/go-coverage/${{ github.ref_name}}.html | ||
|
||
# - name: Upload coverage to s3 | ||
# # ensure this runs regardless of whether the threshold is met using always() | ||
# if: always() && steps.coverage.outputs.report-pathname != '' | ||
# run: | | ||
# aws s3 cp ${{ steps.coverage.outputs.report-pathname }} s3://artifacts.example.com-bucket/go-coverage/${{ github.ref_name}}.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,3 @@ jobs: | |
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... |