Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update diff checks so that the task actually works #1578

Merged
merged 5 commits into from
May 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/github-action-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ jobs:
Link-Format-Checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: scripts/link-format-chk.sh
Build-Table-Checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: scripts/buildtable.pl >/tmp/table.mediawiki || exit 1
Diff-Checks:
name: "Diff Checks (fails until number assignment)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: scripts/diffcheck.sh
3 changes: 3 additions & 0 deletions scripts/diffcheck.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

scripts/buildtable.pl >/tmp/table.mediawiki 2> /dev/null
diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/after.diff || true
if git checkout HEAD^ && scripts/buildtable.pl >/tmp/table.mediawiki 2>/dev/null; then
diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/before.diff || true
Expand All @@ -8,6 +9,8 @@ if git checkout HEAD^ && scripts/buildtable.pl >/tmp/table.mediawiki 2>/dev/null
echo "$newdiff"
exit 1
Copy link
Contributor

@jonatack jonatack May 10, 2024

Choose a reason for hiding this comment

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

Not sure, but maybe seeing exits at this line on the CI and locally that appear to be false negatives on the first run, then green on the next one.

CI: https://github.com/bitcoin/bips/actions/runs/8977001323/job/24831359486#step:3:17

locally:

jon|(19a39e2...):~/bitcoin/bips$ git checkout origin/pr/1557 
Previous HEAD position was 19a39e2 Fix links
HEAD is now at 2f620f5 Fix layer

jon|(2f620f5...):~/bitcoin/bips$ ./scripts/diffcheck.sh
Previous HEAD position was 2f620f5 Fix layer
HEAD is now at 1cf5983 Add information about service vendor
+++ /tmp/after.diff	2024-05-10 11:31:38

jon|(1cf5983...):~/bitcoin/bips$ ./scripts/diffcheck.sh
Previous HEAD position was 1cf5983 Add information about service vendor
HEAD is now at 19a39e2 Fix links
README table matches expected table from BIP files

fi
echo "README table matches expected table from BIP files"
else
echo 'Cannot build previous commit table for comparison'
exit 1
fi