| 1 | name: Tests |
| 2 | |
| 3 | on: |
| 4 | workflow_call: |
| 5 | |
| 6 | permissions: |
| 7 | contents: read |
| 8 | |
| 9 | jobs: |
| 10 | lint: |
| 11 | runs-on: ubuntu-latest |
| 12 | steps: |
| 13 | - uses: actions/checkout@v4 |
| 14 | - uses: astral-sh/ruff-action@v3 |
| 15 | with: |
| 16 | version: 0.3.0 |
| 17 | args: check |
| 18 | - uses: astral-sh/ruff-action@v3 |
| 19 | with: |
| 20 | version: 0.3.0 |
| 21 | args: format --check |
| 22 | |
| 23 | test: |
| 24 | runs-on: ubuntu-latest |
| 25 | strategy: |
| 26 | fail-fast: false |
| 27 | matrix: |
| 28 | python-version: ['3.9', '3.10', '3.11'] |
| 29 | steps: |
| 30 | - uses: actions/checkout@v4 |
| 31 | - uses: actions/setup-python@v5 |
| 32 | with: |
| 33 | python-version: ${{ matrix.python-version }} |
| 34 | cache: pip |
| 35 | cache-dependency-path: requirements_tests.txt |
| 36 | - name: Install dependencies |
| 37 | run: | |
| 38 | python -m pip install --upgrade pip |
| 39 | pip install -e . |
| 40 | pip install -r requirements_tests.txt |
| 41 | - name: Test with pytest |
| 42 | run: pytest |