diff --git a/.github/workflows/keystore.yml b/.github/workflows/keystore.yml index d513666170..06f01638ed 100644 --- a/.github/workflows/keystore.yml +++ b/.github/workflows/keystore.yml @@ -21,6 +21,7 @@ jobs: filters: | src: - 'keystore/**' + - '.github/workflows/keystore.yml' run-tests: name: run tests @@ -43,8 +44,23 @@ jobs: - name: Build run: go build -v ./... + # Runs go tests, uploads results, and skips quarantined flaky tests. + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + - name: Unit Tests - run: go test ./... -coverpkg=./... -coverprofile=coverage.txt + id: run-tests + continue-on-error: true + run: gotestsum --format standard-quiet --junitfile test-results.xml -- ./... + + - name: Analyze and upload test results + uses: smartcontractkit/.github/actions/branch-out-upload@branch-out-upload/v1 + with: + junit-file-path: keystore/test-results.xml + trunk-org-slug: chainlink + trunk-previous-step-outcome: ${{ steps.run-tests.outcome }} + trunk-token: ${{ secrets.TRUNK_API_KEY }} + trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }} build-race-tests: name: race tests @@ -94,7 +110,6 @@ jobs: steps: - name: Fail if any job ran and failed if: needs.changes.outputs.keystore-src == 'true' && - (needs.run-tests.result != 'success' || - needs.build-race-tests.result != 'success') + (needs.run-tests.result != 'success' || + needs.build-race-tests.result != 'success') run: exit 1 - diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml index 72f3c31cd8..3ba6a9e554 100644 --- a/.github/workflows/pkg.yml +++ b/.github/workflows/pkg.yml @@ -8,7 +8,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Go uses: ./.github/actions/setup-go with: @@ -18,8 +17,22 @@ jobs: - name: Build run: go build -v ./... + - name: Download gotestsum + run: go install gotest.tools/gotestsum@latest + - name: Unit Tests - run: go test ./... -coverpkg=./... -coverprofile=coverage.txt + id: run-tests + continue-on-error: true + run: gotestsum --format standard-quiet --junitfile test-results.xml -- ./... -coverpkg=./... -coverprofile=coverage.txt + + - name: Analyze and upload test results + uses: smartcontractkit/.github/actions/branch-out-upload@branch-out-upload/v1 + with: + junit-file-path: test-results.xml + trunk-org-slug: chainlink + trunk-previous-step-outcome: ${{ steps.run-tests.outcome }} + trunk-token: ${{ secrets.TRUNK_API_KEY }} + trunk-job-url: ${{ format('https://github.com/{0}/actions/runs/{1}/job/{2}/attempts/{3}', github.repository, github.run_id, job.check_run_id, github.run_attempt) }} - name: Fuzz Tests # the amount of --seconds here is subject to change based on how long the CI job takes in the future @@ -34,11 +47,11 @@ jobs: if: failure() run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done - - name: Upload Go test results + - name: Upload Go test coverage if: always() uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: - name: go-test-results + name: go-test-coverage path: | ./coverage.txt