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 diff --git a/.github/workflows/script/check-js.sh b/.github/workflows/script/check-js.sh index f8f5d19d08..57638dcf25 100755 --- a/.github/workflows/script/check-js.sh +++ b/.github/workflows/script/check-js.sh @@ -16,6 +16,18 @@ 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 + + # 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" 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"