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:
|
2020-11-24 19:41:10 +08:00
|
|
|
python-version: "3.9"
|
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
|
2021-03-31 11:02:25 +08:00
|
|
|
# FIXME: #4052 fix mypy errors in the exclude directories and remove them below
|
2021-03-20 14:01:13 +08:00
|
|
|
- run: mypy --ignore-missing-imports
|
2021-04-02 15:32:12 +08:00
|
|
|
--exclude '(ciphers|conversions|data_structures|digital_image_processing|dynamic_programming|graphs|hashes|linear_algebra|maths|matrix|other|project_euler|scripts|searches|strings*)/$' .
|
2020-11-20 00:31:31 +08:00
|
|
|
- name: Run tests
|
2020-11-30 01:41:09 +08:00
|
|
|
run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/ --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
|