Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/script/check-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +23 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider uploading the diff as an artifact

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially had that, but thought this was nicer because you can see the syntax-highlighted diff without having to download a file, unpack it, and open it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both are nice in case there's a big diff. But this is a very minor comment, good to go as is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it for now then, but we can add it later if we find it's needed?

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"
10 changes: 9 additions & 1 deletion .github/workflows/script/verify-pr-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here

echo '```' >> $GITHUB_STEP_SUMMARY

exit 1
fi
echo "Success: PR checks are up to date"
echo "Success: PR checks are up to date"
Loading