Skip to content

Change/improve caching #62

Change/improve caching

Change/improve caching #62

Workflow file for this run

# this workflow runs unit tests and checks code style
# for different versions of python on different operating systems
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
tests:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, py: "3.12" }
- { os: ubuntu-latest, py: "3.11" }
- { os: windows-latest, py: "3.10" }
- { os: macOS-latest, py: "3.10" }
- { os: ubuntu-latest, py: "3.10" }
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.config.py }}
run: uv python install ${{ matrix.config.py }}
- name: Install package
run: uv sync --extra dev
- name: Test with pytest
run: uv run pytest tests/ --cov=imf_reader --cov-report=xml
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true
- name: Check code style
run: |
uv run ruff format src tests --check
uv run ruff check src tests