Repository navigation
62 lines (58 loc) · 2.05 KB
/
Copy pathci.yml
File metadata and controls
62 lines (58 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: ci
on:
push:
branches: [master]
pull_request:
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install -e '.[dev]'
- run: ruff check .
- run: ruff format --check .
- run: mypy
test:
name: test (python ${{ matrix.python }})
# setup-python has no 3.9 build for the newest ubuntu-latest image; 22.04 still ships it.
runs-on: ${{ matrix.python == '3.9' && 'ubuntu-22.04' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# mypy (used by the docs-examples test) is installed where it supports the runtime; elsewhere that test skips.
- run: python -m pip install -e . pytest
- if: matrix.python != '3.9'
run: python -m pip install mypy
- run: python -m pytest
# Package linters on the built artifact, then the artifact itself installed into a fresh venv on the floor
# (3.9) and the latest Python, running the README "Testing" example against MockOnlineSim.
# ubuntu-22.04: setup-python has no 3.9 build for the newest ubuntu-latest image.
package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# The last one is the default `python`.
python-version: |
3.9
3.13
- run: python -m pip install build twine check-wheel-contents pyroma
- run: python -m build
- run: python -m twine check --strict dist/*
- run: check-wheel-contents dist/*.whl
- run: pyroma --min 10 dist/*.tar.gz
- name: smoke from artifact (python 3.13)
run: python tests/smoke_artifact.py dist
- name: smoke from artifact (python 3.9)
run: python3.9 tests/smoke_artifact.py dist