Bump pytest from 7.4.3 to 8.1.1 #515
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: Test & Linters | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
poetry-version: ["1.4.0"] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Load cache | |
id: valid-cache | |
uses: actions/cache@v3 | |
with: | |
key: poetry-${{ hashFiles('poetry.lock') }} | |
path: | | |
${{ github.workspace }}/.venv | |
${{ github.workspace }}/requirements.txt | |
- name: Install dependencies | |
if: steps.valid-cache.outputs.cache-hit != 'true' | |
run: | | |
python3 -m venv .venv | |
poetry install | |
poetry export --without-hashes -f requirements.txt > src/requirements.txt | |
linters: | |
name: Linting | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
poetry-version: ["1.4.0"] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Load cache | |
id: valid-cache | |
uses: actions/cache@v3 | |
with: | |
key: poetry-${{ hashFiles('poetry.lock') }} | |
path: | | |
${{ github.workspace }}/.venv | |
${{ github.workspace }}/requirements.txt | |
- name: Run Isort | |
run: | | |
poetry run isort --profile "black" --check src tests | |
- name: Run Flake8 | |
run: | | |
poetry run flake8 src tests | |
- name: Run Black | |
run: | | |
poetry run black --check src tests | |
- name: Run MyPy | |
run: | | |
poetry run mypy src tests | |
tests: | |
name: Tests | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
poetry-version: ["1.4.0"] | |
env: | |
PYTHONPATH: src/ | |
SHA: ${{ github.sha }} | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Load cache | |
id: valid-cache | |
uses: actions/cache@v3 | |
with: | |
key: poetry-${{ hashFiles('poetry.lock') }} | |
path: | | |
${{ github.workspace }}/.venv | |
${{ github.workspace }}/requirements.txt | |
- name: Run tests | |
run: | | |
poetry run pytest -v | |
- name: Coveralls submit | |
run: | | |
poetry run coverage run --source=src/ -m pytest tests/ | |
poetry run coveralls |