Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add GitHub Actions workflow #2

Merged
merged 3 commits into from
May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
branches:
- master

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8
- 3.9

steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install Python dependencies
run: |
pip install '.[test]'

- name: Unit tests
run: |
pytest -v tests

static-analysis:
name: Static analysis
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8
- 3.9

steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install Python dependencies
run: |
pip install '.[test]'

- name: Check by black
run: |
black --check src tests

- name: Check by isort
run: |
isort **/*.py --check-only

- name: Check by flake8
run: |
flake8 src tests