Files
radicle-explorer/.buildkite/explorer-node-checks.yml
Daniel Norman fe6257df45 desktop: Run desktop ci in Buildkite
- Add desktop.yml with the checks from the GitHub desktop workflows
- Skip Buildkite steps for unchanged paths
2026-11-26 14:50:12 +01:00

143 lines
5.3 KiB
YAML

# One `deps` cache volume serves every step here and the e2e step in
# explorer-e2e.yml. The volume is mounted at /cache/bkcache on the agent, and the
# configured paths become links into it. A container step must therefore mount
# that directory, or every link dangles and the job persists nothing.
#
# A job does not write the volume in place. It gets a private copy at start, and
# that copy becomes the version the next job sees if the job exits 0. Concurrent
# jobs are never merged: the last one to exit 0 publishes its whole copy, and
# whatever a job that finished earlier committed is gone.
#
# check therefore runs first, and is the only step that writes content no other
# step produces: the lint caches, and the pinned binaries. The steps that follow
# all copy its version and add nothing unique to it — `npm ci` against the same
# lockfile fetches the same tarballs, and install-binaries does nothing once the
# pinned version is there. Whichever of them commits last keeps everything. The
# one exception is build-smoke, which adds the Open Graph worker's tarballs: when
# another step commits after it, they are lost and fetched again next time.
#
# Stale content is safe. The npm cache is content-addressed, and install-binaries
# keys its download on the pinned version.
#
# Every step starts with `cd explorer`. Cache and artifact paths are resolved
# from the checkout root, so they carry the explorer/ prefix, while the relative
# NPM_CONFIG_CACHE is resolved from explorer/.
env:
CI: "true"
# Applies to every npm and npx call in the step, not just to `npm ci`.
NPM_CONFIG_CACHE: ".npm-cache"
__defs:
# Tracks the major version in .nvmrc and the engines field in package.json.
node_image: &node_image
docker#v5.14.0:
image: "node:24-bookworm"
# Without this the cache volume links point at nothing.
volumes:
- "/cache/bkcache:/cache/bkcache"
environment:
- CI
- NPM_CONFIG_CACHE
# Ships the browsers at /ms-playwright, which is why no step installs them.
# The tag must match @playwright/test in package.json — Playwright refuses to
# run against browsers built for another version.
playwright_image: &playwright_image
docker#v5.14.0:
image: "mcr.microsoft.com/playwright:v1.61.1-noble"
# Chromium exhausts Docker's default 64MB /dev/shm.
ipc: host
volumes:
- "/cache/bkcache:/cache/bkcache"
environment:
- CI
- NPM_CONFIG_CACHE
# Keep this list the same in every step that attaches the volume, here and in
# explorer-e2e.yml.
deps_cache: &deps_cache
name: deps
paths:
- "explorer/.npm-cache"
- "explorer/tests/tmp/bin"
# The eslint and prettier caches, which scripts/check keeps here rather
# than under node_modules so that `npm ci` cannot delete them. A cache
# path is always a directory, so the two files share one.
- "explorer/.lintcache"
explorer_web_changes: &explorer_web_changes
include: "{explorer/**,shared/**,package{,-lock}.json,.npmrc,.nvmrc,.buildkite/explorer-*.yml}"
exclude: "explorer/{crates/**,Cargo.*,rust-toolchain,.cargo/**}"
steps:
- label: "🔎 explorer check"
key: explorer-check
if_changed: *explorer_web_changes
timeout_in_minutes: 10
cache: *deps_cache
plugins:
- *node_image
commands:
- cd explorer
- npm ci
# check does not use the binaries. It installs them while it is the only
# writer of the volume, so that no later step has to win a race to keep
# them. The node image ships curl and xz, so nothing is installed first.
- ./scripts/install-binaries
- npm run check
- label: "🧪 explorer unit-tests"
key: explorer-unit-tests
if_changed: *explorer_web_changes
depends_on: explorer-check
timeout_in_minutes: 10
cache: *deps_cache
plugins:
- *node_image
commands:
- cd explorer
- npm ci
- npm run test:unit
# The http-client suite talks to a real radicle-httpd, so it needs the pinned
# binaries on PATH even though it runs under vitest rather than Playwright.
- label: "🔌 explorer http-client-tests"
key: explorer-http-client-tests
if_changed: *explorer_web_changes
depends_on: explorer-check
timeout_in_minutes: 15
cache: *deps_cache
artifact_paths:
- "explorer/tests/artifacts/**/*"
plugins:
- *node_image
commands:
- cd explorer
- npm ci
- mkdir -p tests/artifacts
- ./scripts/install-binaries
- npm run test:http-client:unit
# playwright.buildSmoke.config.ts sets globalSetup to undefined, so this step
# needs a browser but no Radicle binaries or fixtures.
- label: "🏗 explorer build-smoke"
key: explorer-build-smoke
if_changed: *explorer_web_changes
depends_on: explorer-check
timeout_in_minutes: 30
cache: *deps_cache
artifact_paths:
- "explorer/tests/artifacts/**/*"
plugins:
- *playwright_image
commands:
- cd explorer
- npm ci
- npm run build
- npm run test:e2e -- --project chromium --config playwright.buildSmoke.config.ts
# Bundles the Open Graph worker without deploying it.
# --prefix keeps the relative NPM_CONFIG_CACHE in explorer/
- npm ci --prefix workers/open-graph
- npm run check:open-graph