Skip to content

Commit

Permalink
update workflows to test package
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Yo committed Oct 21, 2024
1 parent 6b85952 commit bceda66
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/go-coverage.yml
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
3 changes: 0 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ jobs:

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

0 comments on commit bceda66

Please sign in to comment.