Skip to content

Commit

Permalink
[ENH] add CI test for unwanted files (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannDubs authored Jul 18, 2024
1 parent 4232055 commit ac526ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/test_update_leaderboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ jobs:
run: python docs/format_sample_sheets.py

- name: Update leaderboard
run: python docs/format_export_leaderboards.py
run: python docs/format_export_leaderboards.py

- name: Run check for unwanted PR files
run: python docs/check_unwanted_files.py
12 changes: 12 additions & 0 deletions docs/check_unwanted_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pathlib import Path

CURRENT_DIR = Path(__file__).parents[1]
RESULTS_DIR = CURRENT_DIR / "results"

# make sure that there are no files `results/**/reference_outputs.json`
# nor `results/**/leaderboard.csv`
matched_files = []
for filename in ["reference_outputs.json", "leaderboard.csv"]:
matched_files += list(RESULTS_DIR.glob(f"**/{filename}"))

assert len(matched_files) == 0, f"The following files should not be present: {matched_files}"

0 comments on commit ac526ce

Please sign in to comment.