From e80e257ee412ca905ed3c927eea0ad05818f2670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 21 Oct 2026 15:03:28 +0200 Subject: [PATCH] Run explorer CI from explorer/ --- .buildkite/explorer-e2e.yml | 9 +++--- .buildkite/explorer-node-checks.yml | 18 ++++++++--- .buildkite/explorer-rust.yml | 7 ++-- .buildkite/explorer-visual.yml | 18 ++++++----- .github/workflows/explorer-build.yml | 30 +++++++++-------- .github/workflows/explorer-check.yml | 28 +++++++++------- .github/workflows/explorer-e2e.yml | 32 +++++++++++-------- .../explorer-http-client-unit-test.yml | 28 +++++++++------- .github/workflows/explorer-rust.yml | 18 +++++++---- .github/workflows/explorer-unit-test.yml | 28 +++++++++------- .github/workflows/explorer-visual.yml | 32 +++++++++++-------- 11 files changed, 145 insertions(+), 103 deletions(-) diff --git a/.buildkite/explorer-e2e.yml b/.buildkite/explorer-e2e.yml index c0f4e2fac..070766864 100644 --- a/.buildkite/explorer-e2e.yml +++ b/.buildkite/explorer-e2e.yml @@ -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. diff --git a/.buildkite/explorer-node-checks.yml b/.buildkite/explorer-node-checks.yml index 6261689ee..3e7d064b3 100644 --- a/.buildkite/explorer-node-checks.yml +++ b/.buildkite/explorer-node-checks.yml @@ -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 diff --git a/.buildkite/explorer-rust.yml b/.buildkite/explorer-rust.yml index b5b49bcd6..d61f71439 100644 --- a/.buildkite/explorer-rust.yml +++ b/.buildkite/explorer-rust.yml @@ -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. diff --git a/.buildkite/explorer-visual.yml b/.buildkite/explorer-visual.yml index 1b5fd1d79..5de4902f8 100644 --- a/.buildkite/explorer-visual.yml +++ b/.buildkite/explorer-visual.yml @@ -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 diff --git a/.github/workflows/explorer-build.yml b/.github/workflows/explorer-build.yml index 0f28e05bf..2653f8c43 100644 --- a/.github/workflows/explorer-build.yml +++ b/.github/workflows/explorer-build.yml @@ -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/**/* diff --git a/.github/workflows/explorer-check.yml b/.github/workflows/explorer-check.yml index a0bd7605e..6bd1b5044 100644 --- a/.github/workflows/explorer-check.yml +++ b/.github/workflows/explorer-check.yml @@ -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 diff --git a/.github/workflows/explorer-e2e.yml b/.github/workflows/explorer-e2e.yml index 640022b22..f97e0451d 100644 --- a/.github/workflows/explorer-e2e.yml +++ b/.github/workflows/explorer-e2e.yml @@ -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/**/* diff --git a/.github/workflows/explorer-http-client-unit-test.yml b/.github/workflows/explorer-http-client-unit-test.yml index dca3d9d7a..40df18c3d 100644 --- a/.github/workflows/explorer-http-client-unit-test.yml +++ b/.github/workflows/explorer-http-client-unit-test.yml @@ -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: | diff --git a/.github/workflows/explorer-rust.yml b/.github/workflows/explorer-rust.yml index 867c5f5b7..8ca4ba42a 100644 --- a/.github/workflows/explorer-rust.yml +++ b/.github/workflows/explorer-rust.yml @@ -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' }} diff --git a/.github/workflows/explorer-unit-test.yml b/.github/workflows/explorer-unit-test.yml index 3ecbd85e8..58d855c81 100644 --- a/.github/workflows/explorer-unit-test.yml +++ b/.github/workflows/explorer-unit-test.yml @@ -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 diff --git a/.github/workflows/explorer-visual.yml b/.github/workflows/explorer-visual.yml index 8c212aaa9..9588dbbea 100644 --- a/.github/workflows/explorer-visual.yml +++ b/.github/workflows/explorer-visual.yml @@ -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