Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 45 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
name: build

# What gets published, rather than what is in the working tree. `tests.yml`
# already lints and tests the sources across the whole matrix; running the same
# flake8 twice bought no extra signal, so this workflow builds the
# distributions instead and proves the wheel stands on its own — no source
# tree, no demos folder, no editable install.

on: [push]

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install package (dev extras)
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Lint with flake8
run: |
flake8 jupyddl tests --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 jupyddl tests --count --statistics
- uses: actions/checkout@v7
with:
submodules: false

- uses: actions/setup-python@v7
with:
python-version: '3.12'

- name: Build the sdist and the wheel
run: |
python -m pip install --upgrade pip build twine
python -m build
twine check dist/*

- name: Install the wheel into a clean environment
run: |
python -m venv /tmp/fresh
/tmp/fresh/bin/pip install dist/*.whl

- name: Plan with the installed package, away from the repository
working-directory: /tmp
run: |
/tmp/fresh/bin/python -c "import jupyddl; print(jupyddl.__version__)"
/tmp/fresh/bin/jupyddl generate gripper -n 3 --seed 1 -o /tmp/smoke
/tmp/fresh/bin/jupyddl solve \
/tmp/smoke/gripper-03-1/domain.pddl \
/tmp/smoke/gripper-03-1/problem.pddl \
-s astar -H lmcut | tee /tmp/plan.txt
grep -q "Valid: True" /tmp/plan.txt

- uses: actions/upload-artifact@v4
with:
name: distributions
path: dist/
24 changes: 22 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
name: format

on:
push:
branches: [main]

concurrency:
group: format-main
cancel-in-progress: false

jobs:
format:
runs-on: ubuntu-latest
steps:
# `github.head_ref` is empty on a push event, so the old `ref:` here was
# a no-op that read as if it did something. This workflow only ever runs
# on main; check that out and say so.
- uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
ref: main

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.14'

- name: Install formatter dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black

- name: Format with black
run: |
black jupyddl tests
black jupyddl tests tools

# web/dist embeds the jupyddl sources verbatim, and pages.yml refuses to
# deploy a bundle that has drifted from them. Reformatting the sources
# and committing without rebuilding would push main into exactly that
# state, so the rebuild has to ride along in the same commit.
- name: Rebuild the browser bundle so it matches the formatted sources
run: python tools/build_web.py

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: pages

# Publish the browser playground to GitHub Pages. The page runs the real
# library under Pyodide, so "deploying" is just bundling the package sources
# and the demo instances alongside the static assets.

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
# Not called `build`: .mergify.yml keys a merge rule on a check named
# `build`, and that must mean the packaging workflow, not this one.
bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: false

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Bundle jupyddl and the demos for the browser
run: python tools/build_web.py

- name: Fail if the committed bundle is stale
run: |
if ! git diff --quiet -- web/dist; then
echo "web/dist is out of date. Run 'python tools/build_web.py' and commit the result." >&2
git diff --stat -- web/dist >&2
exit 1
fi

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
with:
path: web

deploy:
needs: bundle
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
28 changes: 23 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,32 @@ name: tests

on: [push]

concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
# The charts are an optional extra, so most of the matrix runs without
# matplotlib — that is the configuration nearly every user installs,
# and it proves the core stays importable without it. One entry pulls
# it in so `jupyddl/viz/` is actually executed rather than skipped.
extras: [dev]
include:
- os: ubuntu-latest
python-version: '3.12'
extras: dev,viz

name: test (${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.extras }})

env:
MPLBACKEND: Agg

steps:
- uses: actions/checkout@v7
Expand All @@ -19,14 +37,14 @@ jobs:
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install package (dev extras)
- name: Install package (${{ matrix.extras }} extras)
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install -e ".[${{ matrix.extras }}]"
- name: Lint with flake8
run: |
flake8 jupyddl tests --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 jupyddl tests --count --statistics
flake8 jupyddl tests tools --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 jupyddl tests tools --count --statistics
- name: Test with pytest
run: |
pytest --cov=jupyddl --cov-report=xml
Expand Down
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,18 @@ data/*
scripts/*
*.txt
!scripts/ipc.py

# Playground: the Pyodide runtime is vendored locally for offline development
# and browser testing only -- the deployed page loads it from the CDN.
web/vendor/

# web/dist is generated by tools/build_web.py but IS committed, so the page
# works from a plain clone. Re-include it past the build-artefact 'dist/' rule
# above (the directory itself must be un-ignored before its contents can be).
!web/dist/
!web/dist/**

# Generated galleries and animations
gallery/
*.mp4
!promo/*.mp4
7 changes: 6 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# `tests` is the *workflow* name; the checks it reports are the matrix jobs,
# `test (ubuntu-latest, 3.12, dev)` and friends. A rule keyed on
# `check-success=tests` therefore matched nothing and the auto-merge never
# fired. Match the jobs by pattern instead, so adding a Python version to the
# matrix does not silently break merging again.
pull_request_rules:
- name: Assign the main reviewers
conditions:
Expand All @@ -11,7 +16,7 @@ pull_request_rules:
- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
- check-success=tests
- check-success~=^test \(
- check-success=build
- check-success=CodeFactor
actions:
Expand Down
Loading
Loading