2020-10-17 02:53:17 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
2020-11-29 17:41:09 +00:00
|
|
|
# Run only if a file is changed within the project_euler directory and related files
|
2020-10-17 02:53:17 +00:00
|
|
|
paths:
|
2020-11-29 17:41:09 +00:00
|
|
|
- "project_euler/**"
|
|
|
|
- ".github/workflows/project_euler.yml"
|
|
|
|
- "scripts/validate_solutions.py"
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *" # Run everyday
|
2020-10-17 02:53:17 +00:00
|
|
|
|
2020-11-29 17:41:09 +00:00
|
|
|
name: "Project Euler"
|
2020-10-17 02:53:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
project-euler:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-11 10:11:22 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-12-05 04:34:48 +00:00
|
|
|
- uses: astral-sh/setup-uv@v4
|
2024-01-12 17:25:59 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-07-07 03:25:25 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2024-12-05 04:34:48 +00:00
|
|
|
- run: uv sync --group=euler-validate --group=test
|
|
|
|
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
|
2020-10-17 02:53:17 +00:00
|
|
|
validate-solutions:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-11 10:11:22 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-12-05 04:34:48 +00:00
|
|
|
- uses: astral-sh/setup-uv@v4
|
2024-01-12 17:25:59 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-07-07 03:25:25 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2024-12-05 04:34:48 +00:00
|
|
|
- run: uv sync --group=euler-validate --group=test
|
|
|
|
- run: uv run pytest scripts/validate_solutions.py
|
2020-11-29 17:41:09 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|