| 1 |
name: build |
| 2 |
on: |
| 3 |
push: |
| 4 |
pull_request: |
| 5 |
# build weekly at 4:00 AM UTC |
| 6 |
schedule: |
| 7 |
- cron: '0 4 * * 1' |
| 8 |
jobs: |
| 9 |
# this job ensures that tests can run from the packaged version, which means |
| 10 |
# that nose2 is correctly packaging and distributing its tests |
| 11 |
test-sdist: |
| 12 |
name: run tests from packaged source |
| 13 |
runs-on: ubuntu-latest |
| 14 |
steps: |
| 15 |
- uses: actions/checkout@v6 |
| 16 |
- uses: actions/setup-python@v6 |
| 17 |
with: |
| 18 |
python-version: "3.12" |
| 19 |
- name: install build prereqs |
| 20 |
run: pip install build |
| 21 |
- name: test |
| 22 |
run: | |
| 23 |
python -m build --sdist |
| 24 |
version="$(cat nose2/__init__.py | grep '^__version__' | cut -d '"' -f2)" |
| 25 |
cd dist |
| 26 |
tar -xzf "nose2-${version}.tar.gz" |
| 27 |
cd "nose2-${version}" |
| 28 |
pip install -e '.[dev]' |
| 29 |
nose2 -v --pretty-assert |
| 30 |
|
| 31 |
typing: |
| 32 |
name: 'typing (mypy)' |
| 33 |
runs-on: ubuntu-latest |
| 34 |
steps: |
| 35 |
- uses: actions/checkout@v6 |
| 36 |
- uses: actions/setup-python@v6 |
| 37 |
with: |
| 38 |
python-version: "3.12" |
| 39 |
- run: pip install tox |
| 40 |
- run: tox run -e mypy |
| 41 |
|
| 42 |
test: |
| 43 |
strategy: |
| 44 |
fail-fast: false |
| 45 |
matrix: |
| 46 |
# for the matrix, linux on all pythons |
| 47 |
# |
| 48 |
# any additional builds for windows and macos |
| 49 |
# handled via `include` to avoid an over-large test matrix |
| 50 |
os: [ubuntu-latest] |
| 51 |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.9"] |
| 52 |
include: |
| 53 |
- os: windows-latest |
| 54 |
python-version: "3.x" |
| 55 |
- os: macos-latest |
| 56 |
python-version: "3.x" |
| 57 |
name: "python=${{ matrix.python-version }} os=${{ matrix.os }}" |
| 58 |
runs-on: ${{ matrix.os }} |
| 59 |
steps: |
| 60 |
- uses: actions/checkout@v6 |
| 61 |
- uses: actions/setup-python@v6 |
| 62 |
with: |
| 63 |
python-version: ${{ matrix.python-version }} |
| 64 |
allow-prereleases: true |
| 65 |
- name: install tox |
| 66 |
run: python -m pip install -U tox |
| 67 |
- name: test |
| 68 |
run: | |
| 69 |
python -m tox run -m ci |
| 70 |
|
| 71 |
test-mp: |
| 72 |
name: "multiprocessing test run" |
| 73 |
runs-on: ubuntu-latest |
| 74 |
steps: |
| 75 |
- uses: actions/checkout@v6 |
| 76 |
- uses: actions/setup-python@v6 |
| 77 |
with: |
| 78 |
python-version: '3.14' |
| 79 |
- name: install tox |
| 80 |
run: python -m pip install -U tox |
| 81 |
- name: test |
| 82 |
run: | |
| 83 |
python -m tox run -e py314-mp |