Skip to content

ci: update Codecov configuration and workflow #27

ci: update Codecov configuration and workflow

ci: update Codecov configuration and workflow #27

Workflow file for this run

name: Poetry Build
on:
push:
paths:
- "execenv/**"
- "tests/**"
- ".github/workflows/build.yml"
pull_request:
paths:
- "execenv/**"
- "tests/**"
- ".github/workflows/build.yml"
workflow_dispatch:
jobs:
common-checks:
name: Platform-independent Common Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@master
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
id: python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: poetry
- name: Set Poetry environment
run: poetry env use '${{ steps.python.outputs.python-path }}'
- name: Install dependencies (including rich)
run: poetry install -E rich
- name: Lint code and check code formatting using ruff
run: |
poetry run ruff check --output-format=github .
poetry run ruff format --check .
- name: Type-check code using mypy
run: poetry run mypy --check-untyped-defs .
- name: Check import order using isort
run: poetry run isort -c --profile black .
build:
name: Test and Build
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: common-checks
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Set Poetry environment
run: poetry env use '${{ steps.python.outputs.python-path }}'
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest -vvv --cov=execenv --cov-report=xml:coverage.xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: execenv-${{ matrix.os }}-${{ matrix.python-version }}
verbose: true
files: ./coverage.xml
flags: ${{ matrix.os }},${{ matrix.python-version }}
- name: Build package
run: poetry build