|
6 | 6 | workflow_dispatch: |
7 | 7 |
|
8 | 8 |
|
9 | | - |
10 | 9 | jobs: |
| 10 | + test: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 16 | + python-version: [ "3.11", "3.12", "3.13"] |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v4 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + |
| 26 | + - name: Cache pip dependencies |
| 27 | + uses: actions/cache@v3 |
| 28 | + with: |
| 29 | + path: ~/.cache/pip |
| 30 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-pip- |
| 33 | +
|
| 34 | + - name: Install dependencies |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + pip install -e . |
| 38 | + pip install -r requirements-dev.txt |
| 39 | +
|
| 40 | + # - name: Lint with ruff |
| 41 | + # run: | |
| 42 | + # ruff check . |
| 43 | + # ruff format --check . |
| 44 | + |
| 45 | + - name: Test with pytest |
| 46 | + run: | |
| 47 | + pytest --cov=iglu_python --cov-report=xml --cov-report=term-missing --junitxml=junit.xml -o junit_family=legacy |
| 48 | +
|
| 49 | + - name: Upload test results to Codecov |
| 50 | + if: ${{ !cancelled() }} |
| 51 | + uses: codecov/test-results-action@v1 |
| 52 | + with: |
| 53 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 54 | + |
| 55 | + - name: Upload coverage to Codecov |
| 56 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' |
| 57 | + uses: codecov/codecov-action@v5 |
| 58 | + with: |
| 59 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 60 | + file: ./coverage.xml |
| 61 | + fail_ci_if_error: true |
| 62 | + |
11 | 63 | publish: |
12 | 64 | runs-on: ubuntu-latest |
| 65 | + needs: test |
13 | 66 |
|
14 | 67 | steps: |
15 | 68 | - uses: actions/checkout@v4 |
|
0 commit comments