mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Run explorer CI from explorer/
This commit is contained in:
@@ -20,11 +20,11 @@ steps:
|
||||
cache:
|
||||
name: deps
|
||||
paths:
|
||||
- ".npm-cache"
|
||||
- "tests/tmp/bin"
|
||||
- ".lintcache"
|
||||
- "explorer/.npm-cache"
|
||||
- "explorer/tests/tmp/bin"
|
||||
- "explorer/.lintcache"
|
||||
artifact_paths:
|
||||
- "tests/artifacts/**/*"
|
||||
- "explorer/tests/artifacts/**/*"
|
||||
plugins:
|
||||
# Ships the browsers at /ms-playwright, so nothing here installs them. The
|
||||
# tag must match @playwright/test in package.json — Playwright refuses
|
||||
@@ -40,6 +40,7 @@ steps:
|
||||
- CI
|
||||
- NPM_CONFIG_CACHE
|
||||
commands:
|
||||
- cd explorer
|
||||
- npm ci
|
||||
# The image ships no decompressors: install-binaries unpacks .tar.xz
|
||||
# releases, and the repo fixtures are .tar.bz2 archives.
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#
|
||||
# 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"
|
||||
@@ -53,12 +57,12 @@ __defs:
|
||||
deps_cache: &deps_cache
|
||||
name: deps
|
||||
paths:
|
||||
- ".npm-cache"
|
||||
- "tests/tmp/bin"
|
||||
- "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.
|
||||
- ".lintcache"
|
||||
- "explorer/.lintcache"
|
||||
|
||||
steps:
|
||||
- label: "🔎 explorer check"
|
||||
@@ -68,6 +72,7 @@ steps:
|
||||
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
|
||||
@@ -83,6 +88,7 @@ steps:
|
||||
plugins:
|
||||
- *node_image
|
||||
commands:
|
||||
- cd explorer
|
||||
- npm ci
|
||||
- npm run test:unit
|
||||
|
||||
@@ -94,10 +100,11 @@ steps:
|
||||
timeout_in_minutes: 15
|
||||
cache: *deps_cache
|
||||
artifact_paths:
|
||||
- "tests/artifacts/**/*"
|
||||
- "explorer/tests/artifacts/**/*"
|
||||
plugins:
|
||||
- *node_image
|
||||
commands:
|
||||
- cd explorer
|
||||
- npm ci
|
||||
- mkdir -p tests/artifacts
|
||||
- ./scripts/install-binaries
|
||||
@@ -111,10 +118,11 @@ steps:
|
||||
timeout_in_minutes: 30
|
||||
cache: *deps_cache
|
||||
artifact_paths:
|
||||
- "tests/artifacts/**/*"
|
||||
- "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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# CI for the Rust workspace (crates/radicle-httpd, crates/radicle-search).
|
||||
# CI for the Rust workspace (explorer/crates/radicle-httpd,
|
||||
# explorer/crates/radicle-search).
|
||||
#
|
||||
# Each step gets its own named cache volume. Clippy and test each produce a
|
||||
# different target directory, and a shared volume would let whichever step
|
||||
@@ -6,7 +7,7 @@
|
||||
#
|
||||
# These steps run on the agent rather than in a container, so ~-rooted cache
|
||||
# paths work. The toolchain version is not pinned here: rustup reads
|
||||
# ./rust-toolchain.
|
||||
# explorer/rust-toolchain, so every step changes into explorer/ first.
|
||||
#
|
||||
# Every step needs network access to seed.radicle.dev as well as crates.io — the
|
||||
# workspace patches radicle-job to a git dependency served from a Radicle seed.
|
||||
@@ -53,6 +54,7 @@ steps:
|
||||
name: rust-test
|
||||
paths: *cargo_cache
|
||||
commands:
|
||||
- cd explorer
|
||||
- *install_rust
|
||||
- *install_zstd
|
||||
- RUSTFLAGS="-D warnings" cargo build --workspace --all-features
|
||||
@@ -66,6 +68,7 @@ steps:
|
||||
name: rust-lint
|
||||
paths: *cargo_cache
|
||||
commands:
|
||||
- cd explorer
|
||||
- *install_rust
|
||||
# The minimal profile ships neither, and rust-toolchain names no
|
||||
# components. Only this step needs them.
|
||||
|
||||
@@ -40,13 +40,13 @@ steps:
|
||||
cache: &deps_cache
|
||||
name: deps
|
||||
paths:
|
||||
- ".npm-cache"
|
||||
- "tests/tmp/bin"
|
||||
- ".lintcache"
|
||||
- "explorer/.npm-cache"
|
||||
- "explorer/tests/tmp/bin"
|
||||
- "explorer/.lintcache"
|
||||
artifact_paths:
|
||||
# The baseline set that every branch build compares against.
|
||||
- "tests/visual/snapshots/**/*.png"
|
||||
- "tests/artifacts/**/*"
|
||||
- "explorer/tests/visual/snapshots/**/*.png"
|
||||
- "explorer/tests/artifacts/**/*"
|
||||
plugins:
|
||||
# The image ships WebKit as well as Chromium, which this suite needs: the
|
||||
# visual-mobile project uses the iPhone 13 Mini device descriptor, whose
|
||||
@@ -71,6 +71,7 @@ steps:
|
||||
- BUILDKITE_ORGANIZATION_SLUG
|
||||
- BUILDKITE_PIPELINE_SLUG
|
||||
commands:
|
||||
- cd explorer
|
||||
- npm ci
|
||||
# The image ships no decompressors: install-binaries unpacks .tar.xz
|
||||
# releases, and the repo fixtures are .tar.bz2 archives.
|
||||
@@ -90,7 +91,7 @@ steps:
|
||||
timeout_in_minutes: 30
|
||||
cache: *deps_cache
|
||||
artifact_paths:
|
||||
- "tests/artifacts/**/*"
|
||||
- "explorer/tests/artifacts/**/*"
|
||||
plugins:
|
||||
- *playwright_docker
|
||||
commands:
|
||||
@@ -104,16 +105,17 @@ steps:
|
||||
# A master build older than this file uploaded no baselines, so let a
|
||||
# download that finds none pass and judge the result below instead.
|
||||
if [ -n "$$baseline" ]; then
|
||||
buildkite-agent artifact download "tests/visual/snapshots/**/*.png" . --build "$$baseline" || true
|
||||
buildkite-agent artifact download "explorer/tests/visual/snapshots/**/*.png" . --build "$$baseline" || true
|
||||
fi
|
||||
# Comparing with no baselines makes Playwright report all 89 screenshots
|
||||
# as missing, which reads like a total regression. Report the real state
|
||||
# instead, and stop before the expensive part of the step.
|
||||
if ! find tests/visual/snapshots -name '*.png' 2>/dev/null | grep -q .; then
|
||||
if ! find explorer/tests/visual/snapshots -name '*.png' 2>/dev/null | grep -q .; then
|
||||
buildkite-agent annotate "📸 visual: no baselines yet — a master build must publish them first" \
|
||||
--style warning --context visual
|
||||
exit 0
|
||||
fi
|
||||
- cd explorer
|
||||
- npm ci
|
||||
- mkdir -p tests/artifacts
|
||||
- ./scripts/install-binaries
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-build
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-build.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
build:
|
||||
timeout-minutes: 30
|
||||
@@ -25,7 +29,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
@@ -42,4 +46,4 @@ jobs:
|
||||
retention-days: 30
|
||||
if-no-files-found: "ignore"
|
||||
path: |
|
||||
tests/artifacts/**/*
|
||||
explorer/tests/artifacts/**/*
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-check
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-check.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -25,6 +29,6 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
- run: npm ci
|
||||
- run: npm run check
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-e2e
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-e2e.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
timeout-minutes: 30
|
||||
@@ -25,7 +29,7 @@ jobs:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -35,7 +39,7 @@ jobs:
|
||||
id: playwright-dep-cache
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('explorer/package-lock.json') }}
|
||||
|
||||
- name: Install Playwright browsers
|
||||
if: steps.playwright-dep-cache.outputs.cache-hit != 'true'
|
||||
@@ -57,4 +61,4 @@ jobs:
|
||||
retention-days: 30
|
||||
if-no-files-found: "ignore"
|
||||
path: |
|
||||
tests/artifacts/**/*
|
||||
explorer/tests/artifacts/**/*
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-http-client-unit-test
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-http-client-unit-test.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
http-client-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -26,7 +30,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
- run: npm ci
|
||||
- name: Install Radicle binaries
|
||||
run: |
|
||||
|
||||
@@ -3,11 +3,11 @@ name: explorer-rust
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- "explorer/crates/**"
|
||||
- "explorer/Cargo.toml"
|
||||
- "explorer/Cargo.lock"
|
||||
- "explorer/rust-toolchain"
|
||||
- "explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -17,6 +17,10 @@ env:
|
||||
# panics and backtraces, and make builds and caches much smaller.
|
||||
CARGO_PROFILE_DEV_DEBUG: line-tables-only
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Build & Test
|
||||
@@ -26,7 +30,7 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@1.97.1
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: ". -> target"
|
||||
workspaces: "explorer -> target"
|
||||
# Only master saves, so patches share its caches instead of each
|
||||
# storing their own, which pushes the repo over GitHub's 10 GB limit.
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
@@ -49,7 +53,7 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: ". -> target"
|
||||
workspaces: "explorer -> target"
|
||||
# Only master saves, so patches share its caches instead of each
|
||||
# storing their own, which pushes the repo over GitHub's 10 GB limit.
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-unit-test
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-unit-test.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -26,6 +30,6 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
- run: npm ci
|
||||
- run: npm run test:unit
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
name: explorer-visual
|
||||
# Desktop and Rust-only changes don't affect the web app: its tests run
|
||||
# against a pinned, pre-built radicle-httpd.
|
||||
# Only explorer changes, or changes to this workflow, run it. Rust-only
|
||||
# changes don't affect the web app: its tests run against a pinned, pre-built
|
||||
# radicle-httpd.
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "desktop/**"
|
||||
- "crates/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain"
|
||||
- ".cargo/**"
|
||||
- ".github/workflows/desktop-*.yml"
|
||||
- ".github/workflows/explorer-rust.yml"
|
||||
paths:
|
||||
- "explorer/**"
|
||||
- "!explorer/crates/**"
|
||||
- "!explorer/Cargo.toml"
|
||||
- "!explorer/Cargo.lock"
|
||||
- "!explorer/rust-toolchain"
|
||||
- "!explorer/.cargo/**"
|
||||
- ".github/workflows/explorer-visual.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
generate-visual-diffs:
|
||||
concurrency:
|
||||
@@ -41,7 +45,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
node-version-file: "explorer/.nvmrc"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -61,7 +65,7 @@ jobs:
|
||||
uses: actions/cache@v5
|
||||
id: playwright-snapshot-cache
|
||||
with:
|
||||
path: tests/visual/snapshots/**/*
|
||||
path: explorer/tests/visual/snapshots/**/*
|
||||
key: ${{ runner.os }}-snapshots
|
||||
|
||||
- name: Install Playwright browsers
|
||||
@@ -101,7 +105,7 @@ jobs:
|
||||
retention-days: 30
|
||||
if-no-files-found: "ignore"
|
||||
path: |
|
||||
tests/artifacts/**/*
|
||||
explorer/tests/artifacts/**/*
|
||||
|
||||
- name: Check for artifacts
|
||||
id: check_artifacts
|
||||
|
||||
Reference in New Issue
Block a user