Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/go-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ on:

jobs:
tests:
name: Tests
env:
GOPRIVATE: "${{ inputs.go-private }}"
GH_USERNAME: ${{ secrets.gh_username || 'gh-netic-robot' }}
Expand Down Expand Up @@ -87,7 +88,13 @@ jobs:
install-mode: "goinstall"

- name: Go Compile and Test
run: go test -cover -v ./...
run: go test -cover -coverprofile=coverage.txt -v ./...

- name: Archive code coverage results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: code-coverage
path: coverage.txt

- name: Run benchmarks
if: inputs.run-benchmarks
Expand Down Expand Up @@ -163,3 +170,18 @@ jobs:
- name: Clean up private repository access configuration
if: always() && steps.setup_git_creds.outcome == 'success' && inputs.go-private != ''
run: git config --global --unset url."https://${{ env.GH_USERNAME }}:${{ env.GH_TOKEN }}@github.com".insteadOf

code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: tests
permissions:
contents: read
actions: read
pull-requests: write
steps:
- uses: fgrosse/go-coverage-report@8c1d1a09864211d258937b1b1a5b849f7e4f2682 # v1
with:
coverage-artifact-name: code-coverage
coverage-file-name: "coverage.txt"