CI workflow (notionnext-org/NotionNext)
The CI workflow from notionnext-org/NotionNext, explained and optimized by Latchkey.
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the CI workflow from the notionnext-org/NotionNext repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
# PR / main 基础质量门禁:减轻维护者手工验证,仅 Founder 需关注高影响路径 Review
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-types:
name: Lint & type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn type-check
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn test --passWithNoTests
lockfile:
name: Lockfile consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn deps:check-lockfile
docs-site:
name: VitePress build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn docs:site:build
env:
VITE_GISCUS_ENABLED: 'false'
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
# PR / main 基础质量门禁:减轻维护者手工验证,仅 Founder 需关注高影响路径 Review name: CI on: pull_request: branches: [main] push: branches: [main] concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint-and-types: timeout-minutes: 30 name: Lint & type-check runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: yarn - run: yarn install --frozen-lockfile - run: yarn lint - run: yarn type-check test: timeout-minutes: 30 name: Unit tests runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: yarn - run: yarn install --frozen-lockfile - run: yarn test --passWithNoTests lockfile: timeout-minutes: 30 name: Lockfile consistency runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: yarn - run: yarn deps:check-lockfile docs-site: timeout-minutes: 30 name: VitePress build runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc cache: yarn - run: yarn install --frozen-lockfile - run: yarn docs:site:build env: VITE_GISCUS_ENABLED: 'false'
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 4 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.