Validate only submitted Project Euler solution (#3977) · rkalyankumar/Python@ba6310b · GitHub
Skip to content

Commit ba6310b

Browse files
authored
Validate only submitted Project Euler solution (TheAlgorithms#3977)
* Update validate solution script to fetch only submitted solution * Update workflow file with the updated PE script * Fix: do not fetch `validate_solutions.py` script * Update script to use the requests package for API calls * Fix: install requests module * Pytest ignore scripts/ directory
1 parent 25164bb commit ba6310b

3 files changed

Lines changed: 55 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion

.github/workflows/project_euler.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
on:
22
pull_request:
3-
# only check if a file is changed within the project_euler directory and related files
3+
# Run only if a file is changed within the project_euler directory and related files
44
paths:
5-
- 'project_euler/**'
6-
- '.github/workflows/project_euler.yml'
7-
- 'scripts/validate_solutions.py'
5+
- "project_euler/**"
6+
- ".github/workflows/project_euler.yml"
7+
- "scripts/validate_solutions.py"
8+
schedule:
9+
- cron: "0 0 * * *" # Run everyday
810

9-
name: 'Project Euler'
11+
name: "Project Euler"
1012

1113
jobs:
1214
project-euler:
@@ -24,8 +26,10 @@ jobs:
2426
steps:
2527
- uses: actions/checkout@v2
2628
- uses: actions/setup-python@v2
27-
- name: Install pytest
29+
- name: Install pytest and requests
2830
run: |
2931
python -m pip install --upgrade pip
30-
python -m pip install --upgrade pytest
32+
python -m pip install --upgrade pytest requests
3133
- run: pytest scripts/validate_solutions.py
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/validate_solutions.py

Lines changed: 43 additions & 2 deletions

0 commit comments

Comments
 (0)