Skip to content

Commit f691224

Browse files
Merge pull request #49 from python-thread/ci/test-suite
CI/CD: Extended test suite
2 parents 66a28af + de182f2 commit f691224

File tree

1 file changed

+50
-21
lines changed

1 file changed

+50
-21
lines changed

.github/workflows/test-worker.yml

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,73 @@
1-
name: Run Python tests
1+
name: Run Test Suite
22

3-
on: [ push ]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
env:
13+
PIP_DISABLE_PIP_VERSION_CHECK: 1
14+
COVERAGE_IGOR_VERBOSE: 1
15+
FORCE_COLOR: 1 # pytest output color
16+
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
423

524
jobs:
6-
build:
25+
tests:
26+
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
27+
runs-on: "${{ matrix.os }}-latest"
28+
29+
continue-on-error: ${{ startsWith(matrix.python-version, '~') }} # Allows unstable Python versions to fail
730

8-
name: Run tests
9-
runs-on: ubuntu-latest
1031
strategy:
32+
fail-fast: false
1133
matrix:
34+
os:
35+
- ubuntu
36+
- windows
37+
- macos
1238
python-version: ["3.9", "3.10", "3.11", "3.x"]
1339

14-
1540
steps:
16-
- uses: actions/checkout@v3
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
1743

1844
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
45+
uses: actions/setup-python@v5
2046
with:
2147
python-version: ${{ matrix.python-version }}
2248

23-
- name: Install dependencies
49+
- name: Install Python dependencies
2450
run: |
25-
python -m pip install -U pip
26-
python -m pip install -U coverage pytest pytest-cov poetry
51+
set -xe
52+
python -m pip install poetry coverage pytest
2753
python -m poetry install
2854
python -m poetry self add poetry-plugin-export
2955
python -m poetry export -f requirements.txt --output requirements.txt
3056
python -m pip install -r requirements.txt
3157
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-
3858
- name: Test with pytest
3959
run: |
40-
coverage run -m pytest -v -s
60+
set -xe
61+
python -m pytest -sv
4162
42-
- name: Generate Coverage Report
43-
run: |
44-
coverage report -m
63+
check:
64+
if: always()
65+
name: Tests Successful
66+
runs-on: ubuntu-latest
67+
needs: tests
68+
69+
steps:
70+
- name: Whether the whole test suite passed
71+
uses: re-actors/[email protected]
72+
with:
73+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)