diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 776ab0a2d..8a33e8e74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -249,6 +249,43 @@ jobs: with: name: Testing reports pattern: "* report *" + publish-test-reports: + # The test reports as a page at https://pages.flisk.si/@parcels-code/test-reports/, so they can be read + # without downloading an artifact. Only on pushes to main, and it runs none of this repository's code. + name: "Publish test reports (pages.flisk.si)" + runs-on: ubuntu-latest + needs: [merge-test-artifacts] + if: always() && github.event_name == 'push' && github.ref_name == 'main' + permissions: + id-token: write # pages.flisk.si checks this run's OIDC token to know the repository; no secret is used + steps: + # Each report artifact in its own folder, not the merged "Testing reports": there the flaky job's report and + # the ubuntu unit-test report have the same file name, so one of them overwrites the other. + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: "* report *" + path: test-reports + - name: Index page + run: | + cd test-reports + for d in */; do + name=$(printf '%s' "${d%/}" | tr 'A-Z ' 'a-z-') + mv "$d"*.html "${name}.html" + rmdir "$d" + done + { + echo "# Parcels test reports" + echo + echo "pytest reports from commit \`${GITHUB_SHA::7}\` on main, [CI run ${GITHUB_RUN_ID}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})." + echo + for f in *.html; do echo "- [${f%.html}](${f})"; done + } > index.md + - uses: flisk-sh/pages@c1fd27b9ab0c82f42e70dfe1e1b8ad811933b127 # v1.2.4 + continue-on-error: true # an outage of pages.flisk.si never fails this repository's CI + with: + path: test-reports + command: publish + slug: test-reports typechecking: name: "TypeChecking: pixi run typing" runs-on: ubuntu-latest