|
1 | 1 | name: CI |
2 | 2 | on: |
| 3 | + pull_request: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - main |
6 | | - pull_request: |
7 | 7 |
|
8 | | -defaults: |
9 | | - run: |
10 | | - shell: bash -el {0} |
| 8 | +# Automatically stop old builds on the same branch/PR |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
11 | 12 |
|
12 | 13 | jobs: |
13 | | - unit-tests: |
14 | | - name: pytest |
15 | | - timeout-minutes: 10 |
16 | | - runs-on: ${{ matrix.os }} |
17 | | - strategy: |
18 | | - fail-fast: false |
19 | | - matrix: |
20 | | - include: |
21 | | - - { os: ubuntu-latest, environment: py38 } |
22 | | - - { os: ubuntu-latest, environment: py312 } |
23 | | - - { os: windows-latest, environment: py38 } |
24 | | - - { os: windows-latest, environment: py312 } |
25 | | - - { os: macos-latest, environment: py38 } |
26 | | - - { os: macos-latest, environment: py312 } |
| 14 | + pre-commit: |
| 15 | + timeout-minutes: 30 |
| 16 | + runs-on: ubuntu-latest |
27 | 17 | steps: |
28 | 18 | - name: Checkout branch |
29 | 19 | uses: actions/checkout@v4 |
30 | | - with: |
31 | | - ref: ${{ github.ref }} |
32 | | - fetch-depth: 0 |
33 | 20 | - name: Set up pixi |
34 | | - uses: prefix-dev/setup-pixi@v0.8.1 |
| 21 | + uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 |
35 | 22 | with: |
36 | | - environments: ${{ matrix.environment }} |
37 | | - - name: Install repository |
38 | | - run: pixi run -e ${{ matrix.environment }} postinstall |
39 | | - - name: Run unittests |
40 | | - uses: quantco/pytest-action@v2 |
41 | | - with: |
42 | | - report-title: Unit tests ${{ matrix.environment }} |
43 | | - custom-pytest: pixi run -e ${{ matrix.environment }} pytest |
| 23 | + environments: default lint |
| 24 | + - name: pre-commit |
| 25 | + run: pixi run pre-commit-run --color=always --show-diff-on-failure |
44 | 26 |
|
45 | | - pre-commit-checks: |
46 | | - name: Pre-commit Checks |
| 27 | + pytest: |
47 | 28 | timeout-minutes: 30 |
48 | 29 | runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + environment: |
| 34 | + - py38 |
| 35 | + - py39 |
| 36 | + - py310 |
| 37 | + - py311 |
| 38 | + - py312 |
| 39 | + os: |
| 40 | + - ubuntu-latest |
| 41 | + - macos-latest |
| 42 | + - windows-latest |
49 | 43 | steps: |
50 | 44 | - name: Checkout branch |
51 | 45 | uses: actions/checkout@v4 |
52 | 46 | with: |
53 | | - ref: ${{ github.ref }} |
54 | 47 | fetch-depth: 0 |
55 | 48 | - name: Set up pixi |
56 | | - uses: prefix-dev/setup-pixi@v0.8.1 |
| 49 | + uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 |
57 | 50 | with: |
58 | | - environments: lint default |
59 | | - - name: pre-commit |
60 | | - run: pixi run pre-commit-run --color=always --show-diff-on-failure |
| 51 | + environments: ${{ matrix.environment }} |
| 52 | + - name: Install repository |
| 53 | + run: pixi run -e ${{ matrix.environment }} postinstall |
| 54 | + - name: Run pytest |
| 55 | + run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes |
0 commit comments