pyModeS/.github/workflows/run-tests.yml
dependabot[bot] d8dd978730
Bump snok/install-poetry from 1.3.4 to 1.4.0 (#171)
Bumps [snok/install-poetry](https://github.com/snok/install-poetry) from 1.3.4 to 1.4.0.
- [Release notes](https://github.com/snok/install-poetry/releases)
- [Commits](https://github.com/snok/install-poetry/compare/v1.3.4...v1.4.0)

---
updated-dependencies:
- dependency-name: snok/install-poetry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-25 12:22:23 +02:00

71 lines
1.8 KiB
YAML

name: tests
on:
push:
pull_request_target:
workflow_dispatch:
env:
POETRY_VERSION: "1.6.1"
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
uses: actions/cache@v4
if: ${{ !startsWith(runner.os, 'windows') }}
with:
path: |
~/.local
.venv
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- name: Add poetry to windows path
if: "startsWith(runner.os, 'windows')"
run: |
echo "C:\Users\runneradmin\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install and configure Poetry
uses: snok/install-poetry@v1.4.0
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Display Python version
run: poetry run python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
poetry install
- name: Type checking
run: |
poetry run mypy pyModeS
- name: Run tests
run: |
poetry run pytest tests --cov --cov-report term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
env_vars: PYTHON_VERSION