gh actions: capture test timing
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sf1e7bc4f4c01d45ck
diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml
index fcdf9f5..3bb4742 100644
--- a/.github/workflows/go_test.yml
+++ b/.github/workflows/go_test.yml
@@ -88,9 +88,19 @@
run: |
if [ "${{ inputs.include-slow-tests }}" = "false" ]; then
echo "Running tests without slow tests (short mode, no race re-run)"
- GOEXPERIMENT=synctest gotestsum --format testname -- -short ./...
+ GOEXPERIMENT=synctest gotestsum --format testname --jsonfile test-results.json -- -short ./...
else
echo "Running full test suite including slow tests"
- GOEXPERIMENT=synctest gotestsum --format testname -- ./...
- GOEXPERIMENT=synctest gotestsum --format testname -- -race ./...
+ GOEXPERIMENT=synctest gotestsum --format testname --jsonfile test-results.json -- ./...
+ GOEXPERIMENT=synctest gotestsum --format testname --jsonfile test-results-race.json -- -race ./...
fi
+
+ - name: Upload test results
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: sketch-test-results-${{ github.run_id }}
+ path: |
+ ${{ inputs.working-directory || vars.SKETCH_WORKING_DIR || '.'}}/test-results.json
+ ${{ inputs.working-directory || vars.SKETCH_WORKING_DIR || '.'}}/test-results-race.json
+ retention-days: 30