[pre-commit.ci] pre-commit autoupdate #45
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: Tests | |
# On every pull request but push only to main | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
# Only run test if some code have changed | |
- 'pyproject.toml' | |
- 'poetry.lock' | |
- 'felt_upload/**' | |
- '.pre-commit-config.yaml' | |
- '.github/codecov.yml' | |
- 'tests/**' | |
pull_request: | |
concurrency: | |
group: tests-${{ github.head_ref || github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
tests: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.image }} | |
strategy: | |
matrix: | |
os: [Ubuntu, macOS, Windows] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
include: | |
- os: Ubuntu | |
image: ubuntu-22.04 | |
- os: Windows | |
image: windows-2022 | |
- os: macOS | |
image: macos-12 | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: poetry | |
- name: Get full Python version | |
id: full-python-version | |
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
- name: Check lock file | |
run: poetry lock --check | |
- name: Install dependencies | |
run: poetry install --sync | |
- name: Test | |
run: | | |
poetry run pytest --cov-report term-missing --cov-report xml --cov felt_upload | |
- name: Code Coverage Report | |
if: success() | |
uses: codecov/codecov-action@v3 |