Add strategy #2
Workflow file for this run
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: Python | |
"on": | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo env DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends python3-pip python3-virtualenv | |
- name: Lint with flake8 | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install flake8 | |
flake8 . | |
- name: Lint with black | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install black | |
black --check . | |
- name: Lint with isort | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install isort | |
isort --check . | |
- name: Type-check with mypy | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install mypy types-requests | |
mypy --ignore-missing-imports . | |
- name: Lint with pylint | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install -r requirements.txt | |
pip install pylint | |
./.pylint.sh | |
- name: Tests | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install -r requirements.txt | |
pip install pytest | |
pip install -e . | |
pytest | |
- name: Coverage | |
run: | | |
tmpdir="$(mktemp -d)" | |
venv="$tmpdir/venv" | |
virtualenv "$venv" | |
source "$venv/bin/activate" | |
pip install -r requirements.txt | |
pip install coverage pytest | |
pip install -e . | |
coverage run -m pytest | |
coverage report |