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
101 changes: 87 additions & 14 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# `enable-url-completion` below rewrites markdown links only. The banner, the screenshot and
# the LICENSE link are HTML tags with relative paths, which Docker Hub cannot resolve (the
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ jobs:
run: |
if [ -n "$SHIFT" ]; then export BUN_OPTIONS="--preload=$PWD/scripts/ci/shift-clock.ts"; fi
if [ -n "$ZONE" ]; then export TZ="$ZONE"; fi
# The ${...} is JavaScript's, for bun to read, not the shell's.
# shellcheck disable=SC2016
bun -e 'console.log(`the clock reads ${new Date().toString()}`)'
bun test --reporter=junit --reporter-outfile=.junit-check.xml
# The same suite as check's Linux leg, so the zone runs take check's floor. The year-ahead run
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ name: release
# ELECTROBUN_APPLEIDPASS) and fails when one is missing. Hutch signs the app with the Developer ID
# and notarizes it, build-cli.ts does the same for the CLI and build-app.ts for the akou-diarize
# archive, and the job checks all three before upload.
#
# Every job that reads a secret (app, image on a push, image-manifest, cask) runs in the `release`
# environment when it can read one (docs/CI-CD.md CI-16). The environment's deployment policy, set
# in the repository settings, decides which refs may reach its secrets; a gate in this file holds
# only for the copy of the file on the ref that runs.

on:
push:
Expand Down Expand Up @@ -94,6 +99,7 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ env.BUN_VERSION }}
no-cache: true
- run: bun install --frozen-lockfile
- name: every version string equals the tag
env:
Expand Down Expand Up @@ -138,6 +144,10 @@ jobs:
needs: version
runs-on: macos-latest
timeout-minutes: 45
# The signing secrets are read only inside the `release` environment (docs/CI-CD.md CI-16),
# whose deployment policy names the refs that may sign. A pull request's dry run reads none and
# builds ad-hoc, so it runs outside it.
environment: ${{ github.event_name != 'pull_request' && 'release' || '' }}
env:
# Hutch signs the app with the Developer ID and notarizes it; build-cli.ts does the same for
# the CLI, build-app.ts for the akou-diarize archive. A pushed tag (this workflow's only push trigger is v* tags) or a dispatch by hand
Expand Down Expand Up @@ -201,24 +211,17 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ env.BUN_VERSION }}
no-cache: true
- run: bun install --frozen-lockfile
- name: Hutch and the ElectroBun runtime, cached by their pins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.hutch
key: hutch-macos-arm64-electrobun-2.0.1-hutch-0.24.3
# No cache is restored in a job whose build is published (docs/CI-CD.md CI-16): a cache can be
# written by any run on main, so Hutch, the runtime and the recognizer are downloaded and
# checked against their pins here every time.
- name: build the app (helper, pages, Workers, ElectroBun through Hutch)
run: bun scripts/build-app.ts ${HELPER_FLAG:+"$HELPER_FLAG"}
- name: check the built app without opening it
run: bun scripts/smoke-app.ts ${HELPER_FLAG:+"$HELPER_FLAG"}
- name: the update feed is for this app and this version (docs/CI-CD.md CI-23)
run: bun scripts/check-feed.ts --dir dist/release
- name: the recognizer, cached by its pins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: eval-models
key: recognizer-${{ hashFiles('src/main/asr/models.ts') }}
enableCrossOsArchive: true
# Prereleases never wait on a gate (ROADMAP M0), so here the result is recorded, not enforced.
# continue-on-error absorbs a failure but not a stall: a slow model download must not push
# this release job into its own limit.
Expand Down Expand Up @@ -345,12 +348,13 @@ jobs:
rustup toolchain install "$RUST_VERSION" --profile minimal
rustup default "$RUST_VERSION"
cargo --version
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
# This job's builds are never published (see above), so its caches cannot reach a user.
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 # zizmor: ignore[cache-poisoning]
with:
bun-version: ${{ env.BUN_VERSION }}
- run: bun install --frozen-lockfile
- name: Hutch and the ElectroBun runtime, cached by their pins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: ~/.hutch
key: hutch-${{ runner.os }}-x64-electrobun-2.0.1-hutch-0.24.3
Expand All @@ -361,7 +365,7 @@ jobs:
# The recognizer's files are checked against their pins in src/main/asr/models.ts on every
# use, so a stale cache costs a download, never a wrong model. The nightly shares this cache.
- name: the recognizer, cached by its pins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: eval-models
key: recognizer-${{ hashFiles('src/main/asr/models.ts') }}
Expand Down Expand Up @@ -431,6 +435,7 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ env.BUN_VERSION }}
no-cache: true
- run: bun install --frozen-lockfile
- name: build the CLI (bun build --compile)
run: bun scripts/build-cli.ts
Expand Down Expand Up @@ -475,6 +480,8 @@ jobs:
variant: cuda
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
# Docker Hub's secrets only inside the `release` environment, on the push path (CI-16).
environment: ${{ github.event_name == 'push' && 'release' || '' }}
env:
PUSH: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
PLATFORM: ${{ matrix.platform }}
Expand Down Expand Up @@ -523,6 +530,7 @@ jobs:
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-24.04
timeout-minutes: 10
environment: release
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand Down Expand Up @@ -577,6 +585,7 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ env.BUN_VERSION }}
no-cache: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: release-*
Expand Down Expand Up @@ -656,6 +665,7 @@ jobs:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
timeout-minutes: 10
environment: release
permissions:
contents: read
steps:
Expand All @@ -665,6 +675,7 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ env.BUN_VERSION }}
no-cache: true
- name: push the cask bump to the tap
env:
GH_TOKEN: ${{ github.token }}
Expand Down
13 changes: 13 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# zizmor's settings for the `workflows` job of ci.yml (docs/CI-CD.md CI-16). Every action is pinned
# by its full commit SHA, the official ones included: an action referenced by a tag or a branch
# fails the job.
rules:
unpinned-uses:
config:
policies:
"*": hash-pin
# How soon Dependabot proposes a new release is the update policy of CI-13, which
# tests/dependabot.test.ts holds, not a property of the workflows this job lints.
dependabot-cooldown:
ignore:
- dependabot.yml
4 changes: 2 additions & 2 deletions docs/CI-CD.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ changes ─┬─ lint ───────────────────
```

- `changes` decides which legs a PR needs from the paths it touches. A docs-only PR runs `lint` only.
- `lint` runs Biome, both `tsc`, `cargo fmt --check`, `cargo clippy -D warnings`, the generated-reference drift checks ([TESTING §4.3](TESTING.md#43-contracts-the-three-doors-stay-equal): settings, MCP, the CLI reference of CLI-31, the OpenAPI file of PG-A2, the parity table), `scripts/trap-coverage.ts`, `scripts/ci/clock-lint.ts`, and actionlint and zizmor on `.github/`.
- `lint` runs Biome, both `tsc`, `cargo fmt --check`, `cargo clippy -D warnings`, the generated-reference drift checks ([TESTING §4.3](TESTING.md#43-contracts-the-three-doors-stay-equal): settings, MCP, the CLI reference of CLI-31, the OpenAPI file of PG-A2, the parity table), `scripts/trap-coverage.ts`, `scripts/ci/clock-lint.ts`, and actionlint and zizmor on `.github/` (today a job of its own, `workflows`, CI-16).
- `unit` runs `bun test` with the JUnit reporter and the floor check, and `cargo test`. Coverage with its threshold runs on the Linux x64 leg only. The Linux arm64 leg covers the arm64 CLI DESIGN §9 ships, on a runner that is free on public repositories.
- `ci-ok` has `needs:` on every job and `if: always()`, and fails when any needed job failed or was cancelled. Skipped is fine; that is the point of `changes`.

Expand Down Expand Up @@ -99,7 +99,7 @@ CI-3 (squash only) is now part of CI-1. CI-6 (remove the leftover workflow) and
| CI-13 | Dependabot, grouped and weekly | P1 | audit (disabled); Minutes groups by ecosystem | `.github/dependabot.yml` for `bun`, `cargo` and `github-actions`: minor and patch grouped in one PR per ecosystem per week, majors alone, each ignore with its reason. Dependabot alerts and security updates turned on. Squash-merged with an explicit subject and body so no trailer is added | has: `.github/dependabot.yml` (ignores `@types/bun`, which moves with `.bun-version`, and `electrobun`, which moves with the Hutch pins), checked by `tests/dependabot.test.ts`; a monthly `pip` entry for `/docs` bumps the docs site's `zensical` pin; alerts and security updates on since 2026-09-25 |
| CI-14 | Audits beyond alerts | P2 | alerts miss advisories that `audit` finds | Nightly `bun audit` and `cargo audit`; a high or critical finding fails the night | missing |
| CI-15 | CodeQL | P1 | audit (no code scanning) | Code scanning default setup on, first analysis visible under the Security tab | has: default setup on since 2026-09-25 (actions, JavaScript and TypeScript, Rust); the first analysis ran green and opened 13 medium alerts (12 `js/prototype-polluting-assignment` in `src/main/asr/live-worker.ts`, one `js/bad-code-sanitization` in a test), all closed by #42; none open |
| CI-16 | Workflow lint and security scan | P1 | Minutes (actionlint), anarlog (zizmor); public repo | actionlint and zizmor run in `lint` on any `.github/` change; zizmor findings at medium or above fail. zizmor's `unpinned-uses` audit runs with a hash-pin policy for every action, so an action referenced by tag fails; `dangerous-triggers` fails on `pull_request_target`; `artipacked` requires `persist-credentials: false` on every checkout that does not push. One more line in `lint` fails on `secrets.` referenced by any job a `pull_request` event can run. A job may read secrets only when its `if:` limits it to a tag push or `workflow_dispatch`, so a packaging dry run on a pull request builds unsigned. Positive controls: a scratch workflow using `actions/checkout@v4` by tag fails `lint`, and so does a job that reads `secrets.` with a `pull_request` trigger and no such `if:` | partial: SHA pins and no `pull_request_target`; nothing enforces them. The release workflow reads every secret behind `github.event_name == 'push'` or `!= 'pull_request'`, which `tests/release.test.ts` checks |
| CI-16 | Workflow lint and security scan | P1 | Minutes (actionlint), anarlog (zizmor); public repo | actionlint and zizmor run on every `ci.yml` run (the `workflows` job); zizmor findings at medium or above fail. zizmor's `unpinned-uses` audit runs with a hash-pin policy for every action, so an action referenced by tag fails; `dangerous-triggers` fails on `pull_request_target`; `artipacked` requires `persist-credentials: false` on every checkout that does not push. One more line in `lint` fails on `secrets.` referenced by any job a `pull_request` event can run. A job may read secrets only when its `if:` limits it to a tag push or `workflow_dispatch`, so a packaging dry run on a pull request builds unsigned. Every job that reads a secret runs in the `release` environment whenever it can read one (`environment: release`, or an expression that names it behind the same gate as the read), so that with the secrets kept in that environment, its deployment policy decides which refs reach them: tags `v*`, plus `main` while a dispatch dry run must still sign. A workflow pushed on another branch then reads nothing. `dockerhub-description.yml` updates the Hub page on a push to `main` and keeps reading repository secrets. Positive controls: a scratch workflow using `actions/checkout@v4` by tag fails `lint`, and so does a job that reads `secrets.` with a `pull_request` trigger and no such `if:` | has: the `workflows` job of `ci.yml`, under `ci-ok`, runs actionlint 1.7.12 with ShellCheck 0.11.0 and zizmor 1.32.0 (`--min-severity medium`, hash pins for every action in `.github/zizmor.yml`), each a release binary checked against its SHA-256. Every checkout in every workflow sets `persist-credentials: false`, and no job whose build is published restores a cache (`app-desktop`, never published, keeps its caches with an inline ignore). The few ShellCheck notes that are intended carry an inline `disable` with the reason. The release workflow reads every secret behind `github.event_name == 'push'` or `!= 'pull_request'`, and only in jobs that run in the `release` environment; `tests/release.test.ts` checks both (`[WFS-1]`, `[WFS-2]`). The environment and its deployment policy are repository settings: until the secrets move into it, a job with an environment still reads the repository's own |

CI-17 (no secrets on PR code) and CI-18 (actions pinned by SHA) are now part of CI-16, which enforces both.

Expand Down
Loading
Loading