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
8 changes: 8 additions & 0 deletions .github/poetry-requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Poetry, the one tool the docs build installs outside poetry.lock. Pinned
# here and compiled with hashes, so CI can `pip install --require-hashes`:
#
# pip-compile --allow-unsafe --generate-hashes --strip-extras \
# --output-file=.github/poetry-requirements.txt .github/poetry-requirements.in
#
# Keep the version the one poetry.lock was written with.
poetry==2.3.1
755 changes: 755 additions & 0 deletions .github/poetry-requirements.txt

Large diffs are not rendered by default.

55 changes: 37 additions & 18 deletions .github/workflows/cli-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,67 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run; scheduled and
# manual runs queue.
concurrency:
group: cli-drift-${{ github.ref }}
cancel-in-progress: true
group: cli-drift-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: 3.14.10

# Checking against the tip of the default branch, not a pinned rev: a
# CLI that has moved ahead of the docs is what this is here to catch.
# The branch is resolved rather than hardcoded — ComlineProject repos are
# not consistent about `main` vs `master`.
# `HEAD` of the remote is its default branch, whatever that is called
# (ComlineProject repos are not consistent about `main` vs `master`);
# the repo is public, so this needs no token.
- name: Resolve the CLI's current commit
id: cli
env:
GH_TOKEN: ${{ github.token }}
run: |
branch=$(gh api repos/ComlineProject/cli --jq .default_branch)
echo "sha=$(gh api "repos/ComlineProject/cli/commits/$branch" --jq .sha)" >> "$GITHUB_OUTPUT"
sha=$(git ls-remote https://github.com/ComlineProject/cli HEAD | cut -f1)
[[ "$sha" =~ ^[0-9a-f]{40}$ ]] || { echo "::error::no commit for the CLI's HEAD"; exit 1; }
echo "sha=$sha" >> "$GITHUB_OUTPUT"

# Keyed on that exact commit, so an unchanged CLI costs nothing and a
# changed one rebuilds. Without this every run pays a full cargo build.
- name: Cache the comline binary
id: cache
uses: actions/cache@v4
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cargo/bin/comline
key: comline-${{ runner.os }}-${{ steps.cli.outputs.sha }}
key: comline-${{ runner.os }}-rust-1.99.1-${{ steps.cli.outputs.sha }}

# cargo comes preinstalled on the runner image; comline-core and the
# generator crates resolve from the pinned git revs in Cargo.lock.
# The toolchain the CLI pins (its rust-toolchain.toml), by exact version:
# the runner's own Rust is whatever its image has that week.
- name: Install the Rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1

# comline-core and the generator crates resolve from the pinned git revs
# in the CLI's Cargo.lock.
- name: Install the CLI
if: steps.cache.outputs.cache-hit != 'true'
env:
CLI_SHA: ${{ steps.cli.outputs.sha }}
run: |
cargo install --locked --git https://github.com/ComlineProject/cli \
--rev ${{ steps.cli.outputs.sha }} comline
--rev "$CLI_SHA" comline

- name: Check for drift
# `shell: bash` for pipefail: without it the `if !` below reads tee's
Expand All @@ -76,7 +95,7 @@ jobs:
{
echo '### CLI drift'
echo
echo 'The docs and `comline` no longer describe the same surface.'
echo "The docs and \`comline\` no longer describe the same surface."
echo
echo '```'
cat drift.txt
Expand Down
41 changes: 28 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,34 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run. A run on `main`
# is never cancelled: it may be the one deploying.
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- name: Install Poetry
run: pipx install poetry
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
cache: poetry
cache-dependency-path: docs/poetry.lock
python-version: 3.14.10

# Poetry itself comes from a hash-pinned requirements file (poetry and
# every package it needs, compiled with pip-compile); the site's own
# packages come from poetry.lock, whose hashes `poetry install` checks.
- name: Install Poetry
run: pip install --require-hashes --no-deps -r .github/poetry-requirements.txt

- name: Install dependencies
working-directory: docs
Expand Down Expand Up @@ -71,20 +81,25 @@ jobs:

- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/site

deploy:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
21 changes: 15 additions & 6 deletions .github/workflows/encodings-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,28 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run; scheduled and
# manual runs queue.
concurrency:
group: encodings-drift-${{ github.ref }}
cancel-in-progress: true
group: encodings-drift-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
encodings:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: 3.14.10

# Reads the package straight from `core` (default branch), stdlib only.
- name: Check for drift
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/idl-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,28 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run; scheduled and
# manual runs queue.
concurrency:
group: idl-drift-${{ github.ref }}
cancel-in-progress: true
group: idl-drift-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: 3.14.10

# Reads the grammar straight from `core` (default branch), stdlib only —
# no Rust toolchain, no dependencies to install.
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/language-support-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,28 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run; scheduled and
# manual runs queue.
concurrency:
group: language-support-drift-${{ github.ref }}
cancel-in-progress: true
group: language-support-drift-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: 3.14.10

- name: Check for drift
shell: bash
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

# Not `lint-...`: the reusable workflow's own group is that, and groups are
# case-insensitive, so the same name would make the call wait on itself.
concurrency:
group: ci-lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
name: lint
permissions:
contents: read
uses: ComlineProject/.github/.github/workflows/lint.yml@797d473553d7f2fc50895bb2573acb83ac63c7cb # main, no release tag yet
with:
renovate-config: renovate.json
21 changes: 15 additions & 6 deletions .github/workflows/schema-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,28 @@ on:
permissions:
contents: read

# A newer push to the same pull request supersedes this run; scheduled and
# manual runs queue.
concurrency:
group: schema-drift-${{ github.ref }}
cancel-in-progress: true
group: schema-drift-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: 3.14.10

- name: Compare with generation's and core's schemas
shell: bash
Expand Down
Loading
Loading