Adder transformer #80
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Challenge Indexes | |
| on: | |
| pull_request: | |
| paths: | |
| - 'challenges/**' | |
| jobs: | |
| check-index: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Check for duplicate indexes | |
| run: | | |
| python - << 'EOF' | |
| import os | |
| import collections | |
| challenges_dir = "challenges" | |
| questions = collections.defaultdict(list) | |
| for folder in os.listdir(challenges_dir): | |
| folder_path = os.path.join(challenges_dir, folder) | |
| for question in os.listdir(folder_path): | |
| idx = question.split("_")[0] | |
| questions[idx].append(question) | |
| if len(questions[idx]) > 1: | |
| print(f"PR duplicated found: \n {questions[idx]}.") | |
| exit(1) | |
| EOF |