Bump codecov/codecov-action from 3 to 4 #255
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: tests | |
on: | |
push: | |
pull_request_target: | |
workflow_dispatch: | |
env: | |
POETRY_VERSION: "1.6.1" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest # ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
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 }} | |
# Update full Python version | |
- name: Full Python version | |
run: | | |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" | |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" >> $GITHUB_ENV | |
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files). | |
- name: Cache Packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local | |
.venv | |
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install and configure Poetry | |
uses: snok/[email protected] | |
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: Style checking | |
if: ${{ matrix.python-version == '3.10' }} | |
run: | | |
poetry run ruff src tests | |
poetry run ruff format --check src tests | |
- name: Type checking | |
if: ${{ matrix.python-version == '3.10' }} | |
run: | | |
poetry run mypy src tests | |
- name: Run tests | |
run: | | |
poetry run pytest --cov --cov-report xml | |
- name: Upload coverage to Codecov | |
if: ${{ github.event_name != 'pull_request_target' && matrix.python-version == '3.10' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
env_vars: PYTHON_VERSION |