Skip to content

Commit

Permalink
check that Compfiles.lean is up-to-date in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Apr 1, 2024
1 parent 362f004 commit a09cd55
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
result_run1=$?
echo "Complete at $(date +'%T'); return value $result_run1"
- name: check that Compfiles.lean is up to date
id: check-Compfiles-lean
run: |
echo "Running mk_toplevel_file.bash..."
bash ./scripts/mk_toplevel_file.bash
echo "Checking that Compfiles.lean is unchanged..."
echo "(If this fails, you should run ./scripts/mk_toplevel_file.bash locally.)"
bash ./scripts/assert_working_directory_clean.bash
- name: run extractProblems
id: run-extractProblems
run: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ jobs:
result_run1=$?
echo "Complete at $(date +'%T'); return value $result_run1"
- name: check that Compfiles.lean is up to date
id: check-Compfiles-lean
run: |
echo "Running mk_toplevel_file.bash..."
bash ./scripts/mk_toplevel_file.bash
echo "Checking that Compfiles.lean is unchanged..."
echo "(If this fails, you should run ./scripts/mk_toplevel_file.bash locally.)"
bash ./scripts/assert_working_directory_clean.bash
- name: run extractProblems
id: run-extractProblems
run: |
Expand Down
4 changes: 2 additions & 2 deletions Compfiles.lean
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Compfiles.Bulgaria1998P1
import Compfiles.Bulgaria1998P11
import Compfiles.Bulgaria1998P2
import Compfiles.Bulgaria1998P3
import Compfiles.Bulgaria1998P6
import Compfiles.Bulgaria1998P8
import Compfiles.Bulgaria1998P11
import Compfiles.CIIM2022P6
import Compfiles.Canada1998P3
import Compfiles.Canada1998P5
import Compfiles.CIIM2022P6
import Compfiles.Hungary1998P6
import Compfiles.Imo1959P1
import Compfiles.Imo1959P2
Expand Down
12 changes: 12 additions & 0 deletions scripts/assert_working_directory_clean.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

OUTPUT=$(git status --porcelain)

if [ -z $OUTPUT ]; then
echo "Working directory is clean."
else
echo "Working directory is not clean."
echo $OUTPUT
git diff
exit 1
fi
2 changes: 1 addition & 1 deletion scripts/mk_toplevel_file.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# prepend `import `
find Compfiles/ -name \*.lean \
| sed 's,^\./,,;s,/,.,g;s,\.lean$,,;s,^,import ,' \
| sort > Compfiles.lean
| sort -V > Compfiles.lean

0 comments on commit a09cd55

Please sign in to comment.