Skip to content

Commit

Permalink
[build] Add flags to generate test and coverage reports (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg committed Aug 1, 2023
1 parent ea0dd27 commit 1c7c7a5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo sudo sysctl -w net.ipv4.ping_group_range="0 500000"

- name: Test
- name: Test on ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
go install gotest.tools/gotestsum@latest
gotestsum --jsonfile=report.json --rerun-fails --packages=./... -- ${{ env.EXTRA_TEST_FLAGS }} -race -covermode=atomic -coverprofile=cover.out
- name: Test on non-ubuntu
if: ${{ matrix.os != 'ubuntu-latest' }}
run: |
go install gotest.tools/gotestsum@latest
gotestsum --rerun-fails --packages=./... -- ${{ env.EXTRA_TEST_FLAGS }} -race -covermode=atomic
Expand All @@ -74,6 +81,15 @@ jobs:
go test github.com/cloudprober/cloudprober/probes/ping -c
sudo PING_HOSTS_V4=${{ env.PING_HOSTS_V4 }} PING_HOSTS_V6=${{ env.PING_HOSTS_V6 }} ./ping.test -test.v -test.run ^TestRunProbeRealICMP$
- name: Upload test and coverage reports
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
with:
name: test-reports
path: |
report.json
cover.out
build-binaries:
name: Build binaries
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 1c7c7a5

Please sign in to comment.