|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: [push, workflow_call] |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + test: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + python-version: ["3.9", "3.10", "3.11", "3.12"] |
| 12 | + steps: |
| 13 | + # https://github.com/actions/checkout |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + # https://github.com/astral-sh/setup-uv |
| 19 | + - name: Install uv |
| 20 | + uses: astral-sh/setup-uv@v4 |
| 21 | + |
| 22 | + # https://github.com/actions/setup-python |
| 23 | + - name: Set up Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + |
| 28 | + - name: Install Dependencies |
| 29 | + run: uv sync --group dev |
| 30 | + |
| 31 | + - name: Code Quality |
| 32 | + run: uv run black . --check |
| 33 | + |
| 34 | + - name: Test with pytest |
| 35 | + env: |
| 36 | + GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} |
| 37 | + GITLAB_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} |
| 38 | + run: make test |
| 39 | + |
| 40 | + - name: Upload coverage report |
| 41 | + env: |
| 42 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 43 | + GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} |
| 44 | + GITLAB_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} |
| 45 | + COVERALLS_PARALLEL: true |
| 46 | + run: | |
| 47 | + uv run coveralls --service=github-actions |
| 48 | + continue-on-error: true |
| 49 | + |
| 50 | + finish: |
| 51 | + needs: test |
| 52 | + if: ${{ always() }} |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + # https://github.com/coverallsapp/github-action |
| 56 | + - name: Coveralls Finished |
| 57 | + uses: coverallsapp/github-action@v2 |
| 58 | + with: |
| 59 | + parallel-finished: true |
0 commit comments