2020-11-20 00:31:31 +08:00
|
|
|
name: "build"
|
|
|
|
|
|
|
|
on:
|
2020-11-20 01:04:57 +08:00
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *" # Run everyday
|
2020-11-20 00:31:31 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2022-02-13 13:57:44 +08:00
|
|
|
python-version: "3.10"
|
2020-11-20 00:31:31 +08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2020-11-24 19:41:10 +08:00
|
|
|
python -m pip install --upgrade pip setuptools six wheel
|
2021-03-20 14:01:13 +08:00
|
|
|
python -m pip install mypy pytest-cov -r requirements.txt
|
2022-01-26 23:35:51 +08:00
|
|
|
- run: |
|
|
|
|
mkdir -p .mypy_cache
|
2022-02-13 13:57:44 +08:00
|
|
|
mypy --ignore-missing-imports --install-types --non-interactive . || true
|
2020-11-20 00:31:31 +08:00
|
|
|
- name: Run tests
|
2021-10-15 00:19:47 +08:00
|
|
|
run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/validate_solutions.py --cov-report=term-missing:skip-covered --cov=. .
|
2020-11-20 00:31:31 +08:00
|
|
|
- if: ${{ success() }}
|
|
|
|
run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
|