|
1 | | -name: Run Python tests |
| 1 | +name: Run Test Suite |
2 | 2 |
|
3 | | -on: [ push ] |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +defaults: |
| 7 | + run: |
| 8 | + shell: bash |
| 9 | + |
| 10 | +env: |
| 11 | + PIP_DISABLE_PIP_VERSION_CHECK: 1 |
| 12 | + COVERAGE_IGOR_VERBOSE: 1 |
| 13 | + FORCE_COLOR: 1 # pytest output color |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 20 | + cancel-in-progress: true |
4 | 21 |
|
5 | 22 | jobs: |
6 | | - build: |
| 23 | + tests: |
| 24 | + name: "${{ matrix.python-version }} on ${{ matrix.os }}" |
| 25 | + runs-on: "${{ matrix.os }}-latest" |
7 | 26 |
|
8 | | - name: Run tests |
9 | | - runs-on: ubuntu-latest |
10 | 27 | strategy: |
| 28 | + fail-fast: false |
11 | 29 | matrix: |
| 30 | + os: |
| 31 | + - ubuntu |
| 32 | + - windows |
| 33 | + - macos |
12 | 34 | python-version: ["3.9", "3.10", "3.11", "3.x"] |
13 | 35 |
|
14 | | - |
15 | 36 | steps: |
16 | | - - uses: actions/checkout@v3 |
| 37 | + - name: Checkout repository |
| 38 | + uses: actions/checkout@v4 |
17 | 39 |
|
18 | 40 | - name: Set up Python ${{ matrix.python-version }} |
19 | | - uses: actions/setup-python@v4 |
| 41 | + uses: actions/setup-python@v5 |
20 | 42 | with: |
21 | 43 | python-version: ${{ matrix.python-version }} |
22 | 44 |
|
23 | | - - name: Install dependencies |
| 45 | + - name: Install Python dependencies |
24 | 46 | run: | |
25 | | - python -m pip install -U pip |
26 | | - python -m pip install -U coverage pytest pytest-cov poetry |
| 47 | + set -xe |
| 48 | + python -m pip install poetry coverage pytest |
27 | 49 | python -m poetry install |
28 | 50 | python -m poetry self add poetry-plugin-export |
29 | 51 | python -m poetry export -f requirements.txt --output requirements.txt |
30 | 52 | python -m pip install -r requirements.txt |
31 | 53 |
|
32 | | - - name: Lint with Ruff |
33 | | - run: | |
34 | | - python -m pip install -U ruff |
35 | | - ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" . |
36 | | - continue-on-error: true |
37 | | - |
38 | 54 | - name: Test with pytest |
39 | 55 | run: | |
40 | | - coverage run -m pytest -v -s |
| 56 | + set -xe |
| 57 | + python -m pytest -sv |
41 | 58 |
|
42 | | - - name: Generate Coverage Report |
43 | | - run: | |
44 | | - coverage report -m |
| 59 | + success: |
| 60 | + name: Tests Successful |
| 61 | + runs-on: ubuntu-latest |
| 62 | + needs: tests |
| 63 | + |
| 64 | + steps: |
| 65 | + - name: Whether the whole test suite passed |
| 66 | + uses: re-actors/alls-green@release/v1.2.2 |
0 commit comments