| 1 |
name: Run tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: [main] |
| 5 |
pull_request: |
| 6 |
create: |
| 7 |
|
| 8 |
jobs: |
| 9 |
test: |
| 10 |
strategy: |
| 11 |
matrix: |
| 12 |
os: |
| 13 |
- ubuntu-latest |
| 14 |
- ubuntu-24.04-arm |
| 15 |
- windows-latest |
| 16 |
- windows-11-arm |
| 17 |
- macos-15-intel |
| 18 |
- macos-latest |
| 19 |
py: ["3.15", "3.15t", "3.14", "3.14t", "3.13", "3.12", "3.11", "3.10"] |
| 20 |
exclude: |
| 21 |
- os: windows-11-arm |
| 22 |
py: "3.10" |
| 23 |
|
| 24 |
runs-on: ${{ matrix.os }} |
| 25 |
name: Run test with Python ${{ matrix.py }} on ${{ matrix.os }} |
| 26 |
|
| 27 |
steps: |
| 28 |
- name: Checkout |
| 29 |
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 30 |
|
| 31 |
- name: Set up Python |
| 32 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 33 |
with: |
| 34 |
python-version: ${{ matrix.py }} |
| 35 |
allow-prereleases: true |
| 36 |
cache: "pip" |
| 37 |
|
| 38 |
- name: Prepare |
| 39 |
shell: bash |
| 40 |
run: | |
| 41 |
python -m pip install -r requirements.txt pytest |
| 42 |
|
| 43 |
- name: Install pytest-run-parallel under free-threading |
| 44 |
if: contains(matrix.py, 't') |
| 45 |
run: | |
| 46 |
pip install pytest-run-parallel |
| 47 |
|
| 48 |
- name: Build |
| 49 |
shell: bash |
| 50 |
run: | |
| 51 |
make cython |
| 52 |
pip install . |
| 53 |
|
| 54 |
- name: Test (C extension) |
| 55 |
if: ${{ ! contains(matrix.py, 't') }} |
| 56 |
shell: bash |
| 57 |
run: | |
| 58 |
pytest -v test |
| 59 |
|
| 60 |
- name: Test (pure Python fallback) |
| 61 |
if: ${{ ! contains(matrix.py, 't') }} |
| 62 |
shell: bash |
| 63 |
run: | |
| 64 |
MSGPACK_PUREPYTHON=1 pytest -v test |
| 65 |
|
| 66 |
- name: Test (C extension) in parallel under free-threading |
| 67 |
if: contains(matrix.py, 't') |
| 68 |
shell: bash |
| 69 |
run: | |
| 70 |
pytest -v --parallel-threads=auto --iterations=20 test |
| 71 |
|
| 72 |
- name: Test (pure Python fallback) in parallel under free-threading |
| 73 |
if: contains(matrix.py, 't') |
| 74 |
shell: bash |
| 75 |
run: | |
| 76 |
MSGPACK_PUREPYTHON=1 pytest -v --parallel-threads=auto --iterations=20 test |
| 77 |
|
| 78 |
- name: build packages |
| 79 |
shell: bash |
| 80 |
run: | |
| 81 |
python -m build -nv |
| 82 |
|
| 83 |
- name: upload packages |
| 84 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 85 |
with: |
| 86 |
name: dist-${{ matrix.os }}-${{ matrix.py }} |
| 87 |
path: dist |