Add Physical Design Report for CI. #359
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Post PR | |
on: | |
pull_request: | |
types: [closed] | |
env: | |
USER: runner | |
jobs: | |
gen-matrix: | |
name: "Generate test matrix" | |
if: github.event.pull_request.merged == true | |
runs-on: [self-hosted, linux, nixos] | |
env: | |
RUNNERS: 8 | |
outputs: | |
ci-tests: ${{ steps.ci-tests.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: ci-tests | |
name: "Generate matrix" # TODO: why unpassed testcases corresponds to perf testcases | |
run: | | |
echo -n matrix= >> "$GITHUB_OUTPUT" | |
nix shell '.#ammonite' -c .github/scripts/ci.sc postPrMatrixJson --runnersAmount "$RUNNERS" >> "$GITHUB_OUTPUT" | |
run-testcases: | |
name: "Run unpassed and perf testcases" | |
if: github.event.pull_request.merged == true | |
needs: [gen-matrix] | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.gen-matrix.outputs.ci-tests) }} | |
runs-on: [self-hosted, linux, nixos] | |
outputs: | |
result: ${{ steps.ci-run.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: ci-run | |
name: "Run testcases" | |
run: | | |
nix shell '.#ammonite' -c .github/scripts/ci.sc runTests --jobs "${{ matrix.jobs }}" \ | |
--resultDir test-results-$(head -c 10 /dev/urandom | base32) --dontBail true | |
nix shell '.#ammonite' -c .github/scripts/ci.sc convertPerfToMD | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: test-results-${{ matrix.id }} | |
path: | | |
test-results-*/cycle-updates.md | |
test-results-*/failed-tests.md | |
perf-result-*.md | |
report: | |
name: "Report CI result" | |
if: ${{ !cancelled() && github.event.pull_request.merged == true }} | |
needs: [run-testcases] | |
runs-on: [self-hosted, linux, nixos] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: test-reports-* | |
merge-multiple: true | |
- run: | | |
printf "\n\n## Perf Result\n" >> "$GITHUB_STEP_SUMMARY" | |
shopt -s nullglob | |
cat perf-*.md >> "$GITHUB_STEP_SUMMARY" | |
- run: | | |
echo -e "\n## Newly passed tests\n" >> "$GITHUB_STEP_SUMMARY" | |
shopt -s nullglob | |
cat test-results-*/cycle-updates.md >> "$GITHUB_STEP_SUMMARY" | |
- run: | | |
echo -e "\n## Still failing tests\n" >> "$GITHUB_STEP_SUMMARY" | |
shopt -s nullglob | |
cat test-results-*/failed-tests.md >> "$GITHUB_STEP_SUMMARY" |