Change/improve caching #62
This file contains hidden or 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
| # 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 |