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
12 changes: 8 additions & 4 deletions .github/workflows/ci-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ on:
- 'scripts/check-ci-workflows.mjs'
workflow_dispatch:

concurrency:
group: ci-policy-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
contents: read

env:
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: main

jobs:
check:
name: Check CI Workflow Policy
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-check
cancel-in-progress: true
steps:
- uses: actions/checkout@v6

Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ on:
- ".github/workflows/docs.yml"
workflow_dispatch:

concurrency:
group: docs-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}

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

env:
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: main

jobs:
build-docs:
name: Build Combined Docs
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-build-docs
cancel-in-progress: true
steps:
- uses: actions/checkout@v6

Expand All @@ -50,7 +54,7 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
PUPPETEER_SKIP_DOWNLOAD: "true"
run: npm ci
run: npm ci --ignore-scripts

- name: Generate JavaScript API docs
working-directory: js
Expand Down Expand Up @@ -115,6 +119,9 @@ jobs:
name: Deploy GitHub Pages
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
needs: [build-docs]
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.DEPLOY_GITHUB_PAGES == 'true'
permissions:
Expand Down
56 changes: 43 additions & 13 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ on:
required: false
type: string

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

defaults:
run:
working-directory: js

env:
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: main

jobs:
# === DETECT CHANGES - determines which jobs should run ===
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-detect-changes
cancel-in-progress: true
if: github.event_name != 'workflow_dispatch'
outputs:
mjs-changed: ${{ steps.changes.outputs.mjs-changed }}
Expand Down Expand Up @@ -81,6 +86,10 @@ jobs:
changeset-check:
name: Check for Changesets
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-changeset-check
cancel-in-progress: true
needs: [detect-changes]
if: github.event_name == 'pull_request' && needs.detect-changes.outputs.js-code-changed == 'true'
steps:
Expand All @@ -94,17 +103,18 @@ jobs:
node-version: '24.x'

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Check for changesets
env:
# Pass PR context to the validation script
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
# Skip changeset check for automated version PRs
if [[ "${{ github.head_ref }}" == "changeset-release/"* ]]; then
if [[ "$GITHUB_HEAD_REF" == "changeset-release/"* ]]; then
echo "Skipping changeset check for automated release PR"
exit 0
fi
Expand All @@ -119,6 +129,10 @@ jobs:
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-lint
cancel-in-progress: true
needs: [detect-changes]
if: |
github.event_name == 'push' ||
Expand All @@ -137,7 +151,7 @@ jobs:
node-version: '24.x'

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Run ESLint
run: npm run lint
Expand All @@ -152,9 +166,13 @@ jobs:
test:
name: Test (Node.js on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-test-${{ matrix.os }}
cancel-in-progress: true
needs: [detect-changes, changeset-check]
# Run if: push event, OR changeset-check succeeded, OR changeset-check was skipped (docs-only PR)
if: always() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || needs.changeset-check.result == 'success' || needs.changeset-check.result == 'skipped')
if: always() && !cancelled() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || needs.changeset-check.result == 'success' || needs.changeset-check.result == 'skipped')
strategy:
fail-fast: false
matrix:
Expand All @@ -168,7 +186,7 @@ jobs:
node-version: '24.x'

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Run tests
run: npm test
Expand All @@ -177,9 +195,13 @@ jobs:
release:
name: Release
needs: [lint, test]
timeout-minutes: 30
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
# Use always() to ensure this job runs even if changeset-check was skipped
# This is needed because lint/test jobs have a transitive dependency on changeset-check
if: always() && github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.lint.result == 'success' && needs.test.result == 'success'
if: always() && !cancelled() && github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.lint.result == 'success' && needs.test.result == 'success'
runs-on: ubuntu-latest
# Permissions required for npm OIDC trusted publishing
permissions:
Expand All @@ -201,7 +223,7 @@ jobs:
run: node scripts/clean-npm-config.mjs

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Update npm for OIDC trusted publishing
run: node scripts/setup-npm.mjs
Expand Down Expand Up @@ -251,6 +273,10 @@ jobs:
name: Instant Release
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_mode == 'instant'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
# Permissions required for npm OIDC trusted publishing
permissions:
contents: write
Expand All @@ -271,7 +297,7 @@ jobs:
run: node scripts/clean-npm-config.mjs

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Update npm for OIDC trusted publishing
run: node scripts/setup-npm.mjs
Expand Down Expand Up @@ -303,6 +329,10 @@ jobs:
name: Create Changeset PR
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_mode == 'changeset-pr'
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
Expand All @@ -317,7 +347,7 @@ jobs:
node-version: '24.x'

- name: Install dependencies
run: npm install
run: npm ci --ignore-scripts

- name: Create changeset file
run: node scripts/create-manual-changeset.mjs --bump-type "${{ github.event.inputs.bump_type }}" --description "${{ github.event.inputs.description }}"
Expand Down
43 changes: 36 additions & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@ on:
required: false
type: string

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

defaults:
run:
working-directory: python

env:
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: main

jobs:
# === DETECT CHANGES - determines which jobs should run ===
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-detect-changes
cancel-in-progress: true
if: github.event_name != 'workflow_dispatch'
outputs:
py-changed: ${{ steps.changes.outputs.py-changed }}
Expand Down Expand Up @@ -71,6 +76,10 @@ jobs:
changelog:
name: Changelog Fragment Check
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-changelog
cancel-in-progress: true
needs: [detect-changes]
if: github.event_name == 'pull_request' && needs.detect-changes.outputs.any-code-changed == 'true'
steps:
Expand Down Expand Up @@ -117,6 +126,10 @@ jobs:
lint:
name: Lint and Format Check
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-lint
cancel-in-progress: true
needs: [detect-changes]
if: |
github.event_name == 'push' ||
Expand Down Expand Up @@ -155,9 +168,13 @@ jobs:
test:
name: Test (Python ${{ matrix.python-version }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-test-${{ matrix.python-version }}-${{ matrix.os }}
cancel-in-progress: true
needs: [detect-changes, changelog]
# Run if: push event, OR changelog succeeded, OR changelog was skipped (docs-only PR)
if: always() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || needs.changelog.result == 'success' || needs.changelog.result == 'skipped')
if: always() && !cancelled() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || needs.changelog.result == 'success' || needs.changelog.result == 'skipped')
strategy:
fail-fast: false
matrix:
Expand All @@ -183,18 +200,22 @@ jobs:
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
uses: codecov/codecov-action@v6
with:
file: ./python/coverage.xml
files: ./python/coverage.xml
fail_ci_if_error: false
flags: python

# === BUILD PACKAGE ===
build:
name: Build Package
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-build
cancel-in-progress: true
needs: [detect-changes, lint, test]
# Run if: push/dispatch event, OR lint/test succeeded, OR lint/test were skipped (docs-only PR)
if: |
always() && (
always() && !cancelled() && (
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(
Expand Down Expand Up @@ -231,6 +252,10 @@ jobs:
auto-release:
name: Auto Release
needs: [lint, test, build]
timeout-minutes: 30
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -294,6 +319,10 @@ jobs:
manual-release:
name: Manual Release
needs: [lint, test, build]
timeout-minutes: 30
concurrency:
group: main-writer-${{ github.repository }}-main
cancel-in-progress: false
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
Expand Down
Loading
Loading