From f9696a9572cbf6efd8c09967eb9528791301efc8 Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sat, 3 Oct 2026 08:12:18 +0900 Subject: [PATCH] Ci: Run the test suite on GitHub Actions, with and without the binder The shared machine is saturated by local builds, so verification moves to GitHub's runners. tests.yml runs `python -m pytest tests -q -rs` on pull requests into develop, on pushes to work/**, and on demand, in two jobs: - no-binder: this repository alone; the binder tests skip. - with-binder: this repository and thisisthepy/python-multiplatform develop checked out side by side, PYTHONMULTIPLATFORM_HOME pointing at the latter. The tests only read three Kotlin source files from it, so there is no JVM or Gradle step. Side by side rather than nested, because test_wheel.py copies this repository to build the wheel. AGENTS.md section 14 says so, and that local runs are for quick checks of the changed part. feature added: .github/workflows/tests.yml. documentation corrected: AGENTS.md section 14. Local check (no-binder command, worktree without UI.ipynb): 52 passed, 57 skipped. The with-binder job is verified by this pull request's own run. Refs #33 --- .github/workflows/tests.yml | 62 +++++++++++++++++++++++++++++++++++++ AGENTS.md | 3 ++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..10f4165 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +name: Tests + +# The suite runs twice: without the binder checkout (its tests skip) and with +# python-multiplatform develop beside it. The tests only read three Kotlin +# source files from it, so no JVM or Gradle is needed. +on: + pull_request: + branches: [develop] + push: + branches: ['work/**'] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + no-binder: + runs-on: ubuntu-latest + env: + # A path that does not exist, so the binder tests skip. + PYTHONMULTIPLATFORM_HOME: /nonexistent + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: actions/setup-python@v5 + with: + python-version: '3.13' + - run: pip install pytest setuptools wheel + - name: Run the suite + run: python -m pytest tests -q -rs + + with-binder: + runs-on: ubuntu-latest + env: + # The two repositories side by side, as on a developer machine. The binder is not checked out + # inside this one: tests/test_wheel.py copies this repository to build the wheel. + PYTHONMULTIPLATFORM_HOME: ${{ github.workspace }}/python-multiplatform + defaults: + run: + working-directory: pythonx-compose + steps: + - uses: actions/checkout@v4 + with: + path: pythonx-compose + fetch-depth: 1 + - uses: actions/checkout@v4 + with: + repository: thisisthepy/python-multiplatform + ref: develop + path: python-multiplatform + fetch-depth: 1 + - uses: actions/setup-python@v5 + with: + python-version: '3.13' + - run: pip install pytest setuptools wheel + - name: Run the suite + run: python -m pytest tests -q -rs diff --git a/AGENTS.md b/AGENTS.md index b205170..aa8cfe5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -187,6 +187,9 @@ worktree so a test can see it. Read it in place. one they **skip**; with a checkout older than python-multiplatform `ba4c6f49`, 5 of them skip for want of its member resolver (see `docs/SPEC.md` ยง0). Report both numbers and say which environment you ran in. A skip is not a pass. +- The suite runs on GitHub Actions (`.github/workflows/tests.yml`) in both environments, without and + with a python-multiplatform checkout, for every pull request into `develop`. Local runs are for + quick checks of the part you changed; leave the full two-environment run to CI. - `PythonMultiplatform` is read-only from this repository. Never write to it from here. - Record the before and after counts of every change; a change that only touches documentation must leave them identical.