Skip to content

build

build #519

Workflow file for this run

name: build
on:
push:
pull_request:
# build weekly at 4:00 AM UTC
schedule:
- cron: '0 4 * * 1'
jobs:
ruff: # https://beta.ruff.rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github .
# this job ensures that tests can run from the packaged version, which means
# that nose2 is correctly packaging and distributing its tests
test-sdist:
name: run tests from packaged source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: test
run: |
python setup.py sdist
version="$(cat nose2/__init__.py | grep '^__version__' | cut -d '"' -f2)"
cd dist
tar -xzf "nose2-${version}.tar.gz"
cd "nose2-${version}"
pip install -e '.[dev]'
nose2 -v --pretty-assert
test:
needs: ruff
strategy:
fail-fast: false
matrix:
# for the matrix, linux on all pythons
#
# any additional builds for windows and macos
# handled via `include` to avoid an over-large test matrix
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy-3.9"]
include:
- os: windows-latest
python-version: "3.x"
- os: macos-latest
python-version: "3.x"
name: "python=${{ matrix.python-version }} os=${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install tox
run: python -m pip install -U tox
- name: test
run: python -m tox -e py