diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88bf435205..671df81996 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,7 @@ jobs: go-tags: '${{ needs.setup.outputs.go-tags }},deadlock' runs-on: ${{ needs.setup.outputs.compute-large }} enterprise: ${{ needs.setup.outputs.enterprise }} + test-timing-cache-key: go-test-timing-standard secrets: inherit test-go-testonly: @@ -136,6 +137,7 @@ jobs: go-tags: '${{ needs.setup.outputs.go-tags }},deadlock,testonly' runs-on: ${{ needs.setup.outputs.compute-large }} enterprise: ${{ needs.setup.outputs.enterprise }} + test-timing-cache-enabled: false secrets: inherit test-go-race: @@ -161,6 +163,7 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-large }} enterprise: ${{ needs.setup.outputs.enterprise }} name: "race" + test-timing-cache-key: go-test-timing-race secrets: inherit test-go-fips: @@ -186,6 +189,7 @@ jobs: runs-on: ${{ needs.setup.outputs.compute-large }} enterprise: ${{ needs.setup.outputs.enterprise }} name: "fips" + test-timing-cache-key: go-test-timing-fips secrets: inherit test-ui: diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml index f51eb12e11..b3abd54eb6 100644 --- a/.github/workflows/test-go.yml +++ b/.github/workflows/test-go.yml @@ -57,6 +57,16 @@ on: required: false default: false type: boolean + test-timing-cache-enabled: + description: Cache the gotestsum test timing data. + required: false + default: true + type: boolean + test-timing-cache-key: + description: The cache key to use for gotestsum test timing data. + required: false + default: go-test-reports + type: string env: ${{ fromJSON(inputs.env-vars) }} @@ -106,10 +116,13 @@ jobs: - uses: ./.github/actions/set-up-gotestsum - run: mkdir -p test-results/go-test - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + if: inputs.test-timing-cache-enabled with: path: test-results/go-test - key: go-test-reports-${{ github.run_number }} - restore-keys: go-test-reports- + key: ${{ inputs.test-timing-cache-key }}-${{ github.run_number }} + restore-keys: | + ${{ inputs.test-timing-cache-key }}- + go-test-reports- - name: List cached results id: list-cached-results run: ls -lhR test-results/go-test @@ -396,15 +409,17 @@ jobs: path: failure-summary-${{ matrix.id }}${{ inputs.name != '' && '-' || '' }}${{inputs.name}}.md test-collect-reports: - if: ${{ ! cancelled() }} + if: ${{ ! cancelled() && needs.test-go.result == 'success' && inputs.test-timing-cache-enabled }} needs: test-go runs-on: ${{ fromJSON(inputs.runs-on) }} steps: - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: test-results/go-test - key: go-test-reports-${{ github.run_number }} - restore-keys: go-test-reports- + key: ${{ inputs.test-timing-cache-key }}-${{ github.run_number }} + restore-keys: | + ${{ inputs.test-timing-cache-key }}- + go-test-reports- - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: test-results