Skip to content

fix(ci): update build workflow to include coverage report #23

fix(ci): update build workflow to include coverage report

fix(ci): update build workflow to include coverage report #23

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:
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 }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
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
# NOTE: Currently don't run typos on Windows until crate-ci/typos#1095 merged
# - name: "[Windows Only] Install wget for typos"
# if: matrix.os == 'windows-latest'
# run: choco install wget
- name: Check for typos
if: matrix.os != 'windows-latest'
uses: crate-ci/typos@master
- 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
verbose: true
files: ./coverage.xml
env_vars: OS,PYTHON
- name: Build package
run: poetry build