[pre-commit.ci] pre-commit autoupdate #73
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: Test Python package | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: | | |
**/pyproject.toml | |
**/requirements*.txt | |
- run: pip install -e . -r requirements-test.txt | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: > | |
${{ format('pre-commit-{0}-{1}', | |
steps.setup-python.outputs.python-version, | |
hashFiles('.pre-commit-config.yaml') | |
) }} | |
- name: Install pre-commit | |
run: | | |
pip install --upgrade pip | |
pip install pre-commit | |
pre-commit install | |
- name: Run pre-commit hooks | |
run: > | |
git ls-files | xargs pre-commit run | |
--show-diff-on-failure | |
--color=always | |
--files | |
- name: Test with pytest | |
run: > | |
pytest tests | |
--log-cli-level=DEBUG | |
--cov=pydaikin | |
--cov-report=xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-${{ matrix.python-version }} | |
path: coverage.xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml |