From 6a72568b19e19de80199f03a61072469476cfac7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 13:00:48 +0100 Subject: [PATCH 1/4] Run more checks in `unit-tests` job, even when previous checks failed --- .github/workflows/pr-checks.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index fa80525f90..2fd737de86 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -55,17 +55,20 @@ jobs: run: .github/workflows/script/check-js.sh - name: Verify PR checks up to date + if: always() run: .github/workflows/script/verify-pr-checks.sh - name: Run unit tests + if: always() run: npm test - name: Run pr-checks tests + if: always() working-directory: pr-checks run: python -m unittest discover - name: Lint - if: matrix.os != 'windows-latest' + if: always() && matrix.os != 'windows-latest' run: npm run lint-ci - name: Upload sarif From 9cf3a96f631b621a1c5c6182316dad71c651eb70 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 13:06:14 +0100 Subject: [PATCH 2/4] Add transpiled JS to job summary if changed --- .github/workflows/script/check-js.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/script/check-js.sh b/.github/workflows/script/check-js.sh index f8f5d19d08..34d58f68b0 100755 --- a/.github/workflows/script/check-js.sh +++ b/.github/workflows/script/check-js.sh @@ -16,6 +16,13 @@ if [ ! -z "$(git status --porcelain)" ]; then # If we get a fail here then the PR needs attention >&2 echo "Failed: JavaScript files are not up to date. Run 'rm -rf lib && npm run-script build' to update" git status + + echo "### Transpiled JS diff" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```diff' >> $GITHUB_STEP_SUMMARY + git diff --output="$RUNNER_TEMP/js.diff" + cat "$RUNNER_TEMP/js.diff" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY exit 1 fi echo "Success: JavaScript files are up to date" From b4db1860cd5c764a128deefd38d53e7521cd0417 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 13:16:03 +0100 Subject: [PATCH 3/4] Reset working directory before failing in `check-js.sh` --- .github/workflows/script/check-js.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/script/check-js.sh b/.github/workflows/script/check-js.sh index 34d58f68b0..57638dcf25 100755 --- a/.github/workflows/script/check-js.sh +++ b/.github/workflows/script/check-js.sh @@ -23,6 +23,11 @@ if [ ! -z "$(git status --porcelain)" ]; then git diff --output="$RUNNER_TEMP/js.diff" cat "$RUNNER_TEMP/js.diff" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY + + # Reset bundled files to allow other checks to test for changes + git checkout lib + + # Fail this check exit 1 fi echo "Success: JavaScript files are up to date" From 4e65cda8c2d89fa176f6f3cbd94dbcd238bd7ec7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 25 Sep 2025 13:30:00 +0100 Subject: [PATCH 4/4] Add generated workflow diff to job summary if changed --- .github/workflows/script/verify-pr-checks.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/verify-pr-checks.sh b/.github/workflows/script/verify-pr-checks.sh index cf9e79bada..6aa1381e2c 100755 --- a/.github/workflows/script/verify-pr-checks.sh +++ b/.github/workflows/script/verify-pr-checks.sh @@ -20,6 +20,14 @@ if [ ! -z "$(git status --porcelain)" ]; then git diff git status >&2 echo "Failed: PR checks are not up to date. Run 'cd pr-checks && python3 sync.py' to update" + + echo "### Generated workflows diff" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo '```diff' >> $GITHUB_STEP_SUMMARY + git diff --output="$RUNNER_TEMP/workflows.diff" + cat "$RUNNER_TEMP/workflows.diff" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + exit 1 fi -echo "Success: PR checks are up to date" \ No newline at end of file +echo "Success: PR checks are up to date"