Skip to content

Add CI workflow and granular make targets for parallel checks #3

Add CI workflow and granular make targets for parallel checks

Add CI workflow and granular make targets for parallel checks #3

Workflow file for this run

name: PR
on:
pull_request:
branches: [main]
# Cancel in-progress runs when new commits are pushed to the same PR
# so we never waste minutes on outdated code.
concurrency:
group: pr-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: "24"
# Hash all workspace pyproject.toml files so cache invalidates when any
# member's deps change. uv.lock is gitignored, so this is the best key
# available; commit uv.lock to get true lockfile-based caching.
UV_CACHE_GLOB: |
pyproject.toml
framework/*/pyproject.toml
modules/*/pyproject.toml
host/pyproject.toml
jobs:
python-lint:
name: Python lint & format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: true
cache-dependency-glob: ${{ env.UV_CACHE_GLOB }}
- run: make install-py
- run: make ci-python-lint
python-typecheck:
name: Python typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: true
cache-dependency-glob: ${{ env.UV_CACHE_GLOB }}
- run: make install-py
- run: make ci-python-typecheck
python-tests:
name: Python tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: true
cache-dependency-glob: ${{ env.UV_CACHE_GLOB }}
- run: make install-py
- run: make test
js-lint:
name: JS lint & format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: make install-js
- run: make ci-js-lint
js-typecheck:
name: JS typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: make install-js
- run: make ci-js-typecheck
# Single required status check for branch protection.
# Protect `main` with this one check and every leaf job is required transitively.
pr-checks:
name: PR checks
runs-on: ubuntu-latest
needs:
- python-lint
- python-typecheck
- python-tests
- js-lint
- js-typecheck
if: always()
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1