Skip to content

rolled back to attr: approach #50

rolled back to attr: approach

rolled back to attr: approach #50

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
#
name: ci
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
build:
strategy:
matrix:
python-version: [3.9, "3.10", 3.11, 3.12]
platform: [ubuntu-latest, macos-latest, windows-latest]
env:
PRIMARY_PYTHON_VERSION: '3.12'
PRIMARY_PLATFORM: 'ubuntu-latest'
PYTEST_CMD: >
python -m pytest
--junitxml=pytest.xml
--cov-report=term-missing:skip-covered
--cov=src
tests/
runs-on: ${{ matrix.platform }}
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv environment
uses: andgineer/uv-venv@v1
- name: Install dependencies
run: uv pip install -r requirements.dev.txt
- name: Test with pytest
run: ${{ env.PYTEST_CMD }}
- name: Coverage comment
id: coverage_comment
if: ${{ matrix.python-version == env.PRIMARY_PYTHON_VERSION && matrix.platform == env.PRIMARY_PLATFORM }}
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 85
MINIMUM_ORANGE: 70
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v3
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
- name: Upload coverage data to coveralls.io
if: ${{ matrix.python-version == env.PRIMARY_PYTHON_VERSION && matrix.platform == env.PRIMARY_PLATFORM }}
uses: coverallsapp/github-action@v2
- name: Upload Coverage to Codecov
if: ${{ matrix.python-version == env.PRIMARY_PYTHON_VERSION && matrix.platform == env.PRIMARY_PLATFORM }}
uses: codecov/codecov-action@v3