Skip to content

Test and build

Test and build #81

Workflow file for this run

name: Test and build NukeTesting codebase and upload build and results
run-name: Test and build
on:
push:
paths:
- "**.py"
- "**.yaml"
- "**.toml"
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: "Setup project"
run: |
uv sync
- name: Run pytest
run: uv run pytest tests --doctest-modules --html=results/results-${{ matrix.python-version }}.html --self-contained-html
- name: Build package
run: uv run hatch build
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.python-version }}
path: dist/
retention-days: 2
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.python-version }}
path: results/results-${{ matrix.python-version }}.html
retention-days: 2
if: ${{ always() }}