[pre-commit.ci] pre-commit autoupdate #614
This file contains 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: Lint code and run tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: '0 0 * * MON' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
python-version: [3.9] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-v1-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-v1- | |
- name: Install dependencies | |
run: | | |
pip install .[dev] | |
- name: Lint with flake8 | |
run: | | |
flake8 | |
if: always() | |
- name: Format with black | |
run: | | |
black --check --line-length 120 . | |
if: always() | |
- name: Import sort | |
run: | | |
isort --check-only . | |
if: always() | |
- name: Test with pytest | |
run: | | |
pytest | |
if: always() |