From 8a6ba658f0223c51874075ee4d0c7f8da23340db Mon Sep 17 00:00:00 2001 From: JP Cottin Date: Fri, 15 May 2026 23:37:01 -0700 Subject: [PATCH] ci: add GitHub Actions workflow to run pytest on PRs Add .github/workflows/test.yml. One job, pytest, matrix over Python 3.10 / 3.11 / 3.12 / 3.13 (matching the `python = "^3.10"` constraint in pyproject.toml). Triggers on every pull request and every push to master. The workflow: - Sets up the matrix Python version (with pip cache). - pip install -e . to install runtime deps via the pyproject poetry-core build backend. - pip install pytest mock (test deps not in the main install set). - pytest tests/ --ignore=tests/e2e (the e2e tests need Docker + KVM and won't run on GitHub-hosted runners). - fail-fast: false so one Python version's failure doesn't mask the others. This is the first CI on the repo. The unit tests under tests/ now have an automated gate before changes land on master. --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7faba15 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: tests + +on: + pull_request: + push: + branches: [master] + +jobs: + pytest: + name: pytest (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + + - name: Install package + test deps + run: | + python -m pip install --upgrade pip + pip install -e . + pip install pytest mock + + - name: Run tests + run: pytest tests/ --ignore=tests/e2e -v