.github/workflows/test.yml
name: Lint & Test
on: [push, pull_request]
jobs:
lint:
strategy:
matrix:
python-version: ["3.10"]
poetry-version: ["1.3.2"]
os: ["ubuntu-20.04"]
command:
- poetry run pylint dbcl
- poetry run bandit dbcl
- poetry run black --check --diff .
name: "${{ matrix.command }} (Python ${{ matrix.python-version}} Poetry ${{ matrix.poetry-version}} ${{ matrix.os}})"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install poetry ${{ matrix.poetry-version }}
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: Running command "${{ matrix.command }}"
run: |
${{ matrix.command }}
test:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.3.2"]
os: ["ubuntu-20.04", "ubuntu-22.04"]
command:
- poetry run pytest -v
name: "${{ matrix.command }} (Python ${{ matrix.python-version}} Poetry ${{ matrix.poetry-version}} ${{ matrix.os}})"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install poetry ${{ matrix.poetry-version }}
run: pipx install poetry==${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: Running command "${{ matrix.command }}"
run: |
${{ matrix.command }}