File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Upload test sketches report artifact
2+
3+ on :
4+ pull_request :
5+ types :
6+ - opened
7+ - synchronize
8+ # The "labeled" event can be used to easily retrigger the workflow to restore the workflow artifact after it
9+ # expires every 90 days.
10+ - labeled
11+
12+ jobs :
13+ upload :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v2
19+
20+ # The action only does a deltas report when the sketches report's `commit_hash` value matches the PR head SHA
21+ - name : Update commit hash in reports
22+ run : |
23+ # Set up dedicated folder for the updated sketches reports (it's not possible to modify them in place)
24+ SKETCHES_REPORTS_PATH="${{ runner.temp }}/sketches-reports"
25+ # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
26+ echo "SKETCHES_REPORTS_PATH=$SKETCHES_REPORTS_PATH" >> "$GITHUB_ENV"
27+ mkdir --parents "$SKETCHES_REPORTS_PATH"
28+
29+ cd "${{ github.workspace }}/.github/workflows/testdata/sketches-reports/"
30+ for reportFile in *.json; do
31+ jq '.commit_hash = "${{ github.event.pull_request.head.sha }}"' "$reportFile" > "${SKETCHES_REPORTS_PATH}/$reportFile"
32+ done
33+
34+ - name : Save sketches report as workflow artifact
35+ uses : actions/upload-artifact@v2
36+ with :
37+ if-no-files-found : error
38+ path : ${{ env.SKETCHES_REPORTS_PATH }}
39+ name : sketches-reports
You can’t perform that action at this time.
0 commit comments