Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(ci): migrate web to nix cache namespace (#5048)

teo8cf3f556bb94
diff --git a/.github/actions/setup-nix-dev-shell/action.yml b/.github/actions/setup-nix-dev-shell/action.yml
new file mode 100644
index 0000000000..2fc8f19ef8
--- /dev/null
+++ b/.github/actions/setup-nix-dev-shell/action.yml
@@ -0,0 +1,15 @@
+name: Setup Nix dev shell
+description: Enter the repository Nix dev shell without configuring a cache provider.
+
+runs:
+ using: composite
+ steps:
+ - name: Enter Nix dev shell
+ shell: bash
+ run: |
+ set -euo pipefail
+ dev_env="$RUNNER_TEMP/nix-dev-env"
+ nix print-dev-env --accept-flake-config > "$dev_env"
+ echo "BASH_ENV=$dev_env" >> "$GITHUB_ENV"
+ source "$dev_env"
+ printf '%s\n' "$PATH" | tr ':' '\n' >> "$GITHUB_PATH"
diff --git a/.github/actions/setup-reqs-web/action.yml b/.github/actions/setup-reqs-web/action.yml
index 743e376f2e..71120a227a 100644
--- a/.github/actions/setup-reqs-web/action.yml
+++ b/.github/actions/setup-reqs-web/action.yml
@@ -5,24 +5,12 @@ inputs:
description: Install Playwright and cache
required: false
default: ''
- cachix-auth-token:
- description: Cachix auth token used to configure authenticated pulls.
- required: false
- default: ''
- sccache-bucket:
- description: Optional S3 bucket for shared sccache storage.
- required: false
- default: ''
runs:
using: composite
steps:
- name: Setup Nix dev shell
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ inputs.cachix-auth-token }}
- dev-shell: 'true'
- sccache-bucket: ${{ inputs.sccache-bucket }}
+ uses: ./.github/actions/setup-nix-dev-shell
- name: Setup bunfig.toml
shell: bash
diff --git a/.github/workflows/build_appimage_on_tag.yml b/.github/workflows/build_appimage_on_tag.yml
index 1c956982b0..e8782e2bce 100644
--- a/.github/workflows/build_appimage_on_tag.yml
+++ b/.github/workflows/build_appimage_on_tag.yml
@@ -21,7 +21,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.yml
index dee18188df..6dc52fa238 100644
--- a/.github/workflows/build_desktop_on_tag.yml
+++ b/.github/workflows/build_desktop_on_tag.yml
@@ -84,7 +84,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
diff --git a/.github/workflows/code_check_conventions.yml b/.github/workflows/code_check_conventions.yml
index 930fb22fbb..da4977af7d 100644
--- a/.github/workflows/code_check_conventions.yml
+++ b/.github/workflows/code_check_conventions.yml
@@ -52,16 +52,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Run ast-grep
run: bunx --yes @ast-grep/[email protected] scan
status-check:
diff --git a/.github/workflows/code_check_infra.yml b/.github/workflows/code_check_infra.yml
index d7625aab28..e0645d3988 100644
--- a/.github/workflows/code_check_infra.yml
+++ b/.github/workflows/code_check_infra.yml
@@ -27,7 +27,7 @@ jobs:
- 'infra/**'
- 'flake.nix'
- 'flake.lock'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
- '.github/workflows/code_check_infra.yml'
biome-check:
needs:
@@ -43,15 +43,12 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Run Biome
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
working-directory: infra
@@ -66,16 +63,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: install
run: bun install --frozen-lockfile
working-directory: infra
diff --git a/.github/workflows/deploy_all_services.yml b/.github/workflows/deploy_all_services.yml
index 965ad02b94..544776cd06 100644
--- a/.github/workflows/deploy_all_services.yml
+++ b/.github/workflows/deploy_all_services.yml
@@ -75,7 +75,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
@@ -112,7 +112,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
@@ -155,7 +155,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
@@ -215,7 +215,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
diff --git a/.github/workflows/deploy_preview.yml b/.github/workflows/deploy_preview.yml
index cb108414c5..711e919d23 100644
--- a/.github/workflows/deploy_preview.yml
+++ b/.github/workflows/deploy_preview.yml
@@ -32,15 +32,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup
uses: './.github/actions/setup-reqs-web'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: just build-dev
env:
diff --git a/.github/workflows/deploy_web_app.yml b/.github/workflows/deploy_web_app.yml
index c6bef1e93c..da462bae72 100644
--- a/.github/workflows/deploy_web_app.yml
+++ b/.github/workflows/deploy_web_app.yml
@@ -28,8 +28,6 @@ on:
required: true
POSTHOG_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
workflow_dispatch:
inputs:
environment:
@@ -56,15 +54,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Setup
uses: ./.github/actions/setup-reqs-web
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: just build-${{ inputs.environment }}
env:
diff --git a/.github/workflows/deploy_web_app_dev_push.yml b/.github/workflows/deploy_web_app_dev_push.yml
index 3d1405d1c9..6e5b2a91c0 100644
--- a/.github/workflows/deploy_web_app_dev_push.yml
+++ b/.github/workflows/deploy_web_app_dev_push.yml
@@ -36,7 +36,6 @@ jobs:
DD_WEB_APP_TOKEN: ${{ secrets.DD_WEB_APP_TOKEN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_PRODUCTION }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
- CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
diff --git a/.github/workflows/preview-fly.yml b/.github/workflows/preview-fly.yml
index 9323ad0e7d..9b094642fd 100644
--- a/.github/workflows/preview-fly.yml
+++ b/.github/workflows/preview-fly.yml
@@ -30,11 +30,12 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: rust
+ cache: nix
path: |-
- /nix
${{ github.workspace }}/target
/home/runner/.cache/macro-preview-snapshots
+ /home/runner/.cargo/registry
+ /home/runner/.cargo/git
continue-on-error: true
- name: Prune stale incremental caches
run: rm -rf target/*/debug/incremental target/debug/incremental
@@ -44,8 +45,6 @@ jobs:
uses: './.github/actions/setup-nix'
- name: Setup dev shell + web deps
uses: './.github/actions/setup-reqs-web'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure Namespace remote sccache
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository
run: |-
diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml
index 8e5de91f1b..68b3a496fa 100644
--- a/.github/workflows/release-production.yml
+++ b/.github/workflows/release-production.yml
@@ -32,22 +32,20 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- # Namespace cache volume: warm Nix dev shell + bun cache shared with the
- # web PR checks / previews / dev deploys. Optimization only, hence
- # continue-on-error.
+ # Namespace's native Nix cache plus Bun's explicit package-cache path,
+ # shared with web PR checks / previews / dev deploys. Bun comes from the
+ # Nix shell, so its native cache planner cannot run this early.
- name: Mount Namespace cache volume
continue-on-error: true
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1.4.3
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
# Namespace runners don't ship Nix; must run before setup-reqs-web.
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Setup Prereqs
uses: ./.github/actions/setup-reqs-web
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build for Production
working-directory: apps/web
run: just build-prod
@@ -77,14 +75,12 @@ jobs:
continue-on-error: true
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1.4.3
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Setup Prereqs
uses: ./.github/actions/setup-reqs-web
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Download Build Artifact
uses: actions/download-artifact@v5
with:
diff --git a/.github/workflows/reusable_deploy_service.yml b/.github/workflows/reusable_deploy_service.yml
index 868004f40f..9f8eb67c50 100644
--- a/.github/workflows/reusable_deploy_service.yml
+++ b/.github/workflows/reusable_deploy_service.yml
@@ -79,7 +79,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
@@ -134,7 +134,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
diff --git a/.github/workflows/reusable_preview_service.yml b/.github/workflows/reusable_preview_service.yml
index 2ab849a05d..7dc4926da8 100644
--- a/.github/workflows/reusable_preview_service.yml
+++ b/.github/workflows/reusable_preview_service.yml
@@ -52,7 +52,7 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index 739671f575..8065287087 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -37,7 +37,7 @@ jobs:
- 'Cargo.lock'
- 'rust-toolchain.toml'
- 'services/lexical-service/**'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
- '.github/actions/setup-reqs-web/**'
- '.github/workflows/web-app-check-main.yml'
api_changed:
@@ -50,7 +50,7 @@ jobs:
- 'flake.lock'
- 'apps/web/scripts/generate-api-schema.ts'
- 'apps/web/scripts/services.ts'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
- '.github/actions/setup-reqs-web/**'
- '.github/workflows/web-app-check-main.yml'
typescript:
@@ -65,15 +65,16 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun,rust
- path: /nix
+ cache: nix
+ path: |-
+ /home/runner/.bun/install/cache
+ /home/runner/.cargo/registry
+ /home/runner/.cargo/git
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Prereqs
uses: './.github/actions/setup-reqs-web'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure Namespace remote sccache
if: ((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository) && (needs.path-check.outputs.api_changed == 'true')
run: |-
@@ -129,15 +130,12 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Run Biome
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
working-directory: apps/web
@@ -158,15 +156,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Prereqs
uses: './.github/actions/setup-reqs-web'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Check Tailwind Classes
run: just check-tailwind
working-directory: apps/web
@@ -182,15 +178,14 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup
uses: './.github/actions/setup-reqs-web'
with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
playwright: 'true'
- name: Test
run: bunx vitest
@@ -207,15 +202,12 @@ jobs:
- name: Mount /nix cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- path: /nix
+ cache: nix
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Cycles Import Check
run: biome lint --changed --no-errors-on-unmatched --only=suspicious/noImportCycles
working-directory: apps/web
@@ -234,15 +226,13 @@ jobs:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
with:
- cache: bun
- path: /nix
+ cache: nix
+ path: /home/runner/.bun/install/cache
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup
uses: './.github/actions/setup-reqs-web'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: just build-dev
working-directory: apps/web
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
index dfac65c4df..6bceed8815 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
@@ -56,7 +56,7 @@ fn rust_ci_job() -> Job {
.add_step(checkout())
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_dev_shell())
+ .add_step(steps::setup_cachix_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
}
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
index 4a55b808c7..4fc4268652 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
@@ -69,7 +69,7 @@ fn check() -> Job {
.add_step(steps::checkout(false, false))
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_dev_shell())
+ .add_step(steps::setup_cachix_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
.add_step(validate_doppler_configs())
.add_step(cargo_fmt())
@@ -92,7 +92,7 @@ fn test() -> Job {
.add_step(steps::checkout(false, false))
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_dev_shell())
+ .add_step(steps::setup_cachix_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
.add_step(configure_postgres())
.add_step(prepare_tests())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
index 878434c3d2..8798e4eec3 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
@@ -114,7 +114,7 @@ fn paths_filter() -> Step<Use> {
- 'infra/**'
- 'flake.nix'
- 'flake.lock'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
- '.github/workflows/code_check_infra.yml'
"#},
))
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
index 2ac19abefa..9a720382c3 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
@@ -87,8 +87,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
required: true
POSTHOG_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
"#})?,
);
Ok(())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app_dev_push.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app_dev_push.rs
index 01e3c14e84..9b136d81b2 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app_dev_push.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app_dev_push.rs
@@ -45,7 +45,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
DD_WEB_APP_TOKEN: ${{ secrets.DD_WEB_APP_TOKEN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_PRODUCTION }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
- CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
"#})?,
);
Ok(())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
index e9768a0b06..6243bfd74c 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
@@ -88,10 +88,20 @@ pub fn setup_nix() -> Step<Use> {
}
/// Enter the repo's Nix dev shell (toolchain, mold, just, the sccache binary,
-/// and `RUSTC_WRAPPER=sccache`). We pass no S3 bucket; jobs that compile Rust
-/// follow this with [`configure_namespace_sccache`] to use Namespace's official
-/// remote cache. Requires [`setup_nix`] first.
+/// and `RUSTC_WRAPPER=sccache`) without selecting an sccache provider or
+/// configuring an external Nix binary cache. Jobs that compile Rust can follow
+/// this with [`configure_namespace_sccache`] to use Namespace's official remote
+/// cache. Requires [`setup_nix`] first.
pub fn setup_dev_shell() -> Step<Use> {
+ uses_local(
+ "Setup Nix dev shell",
+ xtask_paths::repo_dir!(".github/actions/setup-nix-dev-shell"),
+ )
+}
+
+/// Configure Cachix and enter the repo's Nix dev shell. This is retained for
+/// workflow families that have not yet migrated to Namespace's Nix cache.
+pub fn setup_cachix_dev_shell() -> Step<Use> {
uses_local(
"Setup Nix dev shell",
xtask_paths::repo_dir!(".github/actions/setup-cachix"),
@@ -132,11 +142,11 @@ pub fn mount_cache_volume_with_cargo_target() -> Step<Use> {
"nscloud-cache-action",
"15799a6b54e5765f85b2aac25b3f0df43ed571c0", // v1.4.3
)
- .add_with(("cache", "rust"))
+ .add_with(("cache", "nix"))
.add_with((
"path",
format!(
- "/nix\n${{{{ github.workspace }}}}/target\n{}",
+ "${{{{ github.workspace }}}}/target\n{}\n/home/runner/.cargo/registry\n/home/runner/.cargo/git",
vars::PREVIEW_SNAPSHOT_VOLUME_DIR,
),
))
@@ -192,11 +202,12 @@ fi"#
))
}
-/// Mount the web-app cache volume: bun's install cache plus the Nix store
-/// (dev shell closure). `with_rust` additionally persists the cargo registry
-/// and git state used by the `gen-api` OpenAPI-binary build; its compiled
-/// objects live in Namespace's official remote sccache. `continue-on-error`
-/// for the same reason as [`mount_cache_volume`].
+/// Mount the web-app cache volume using Namespace's native Nix integration.
+/// Bun's install cache is mounted as an explicit path because Bun comes from
+/// the Nix dev shell and is not available when this step runs. `with_rust`
+/// additionally persists cargo registry/git data for the `gen-api`
+/// OpenAPI-binary build; compiled objects live in Namespace's remote sccache.
+/// `continue-on-error` for the same reason as [`mount_cache_volume`].
pub fn mount_web_cache_volume(with_rust: bool) -> Step<Use> {
Step::new("Mount Namespace cache volume")
.uses(
@@ -204,20 +215,31 @@ pub fn mount_web_cache_volume(with_rust: bool) -> Step<Use> {
"nscloud-cache-action",
"15799a6b54e5765f85b2aac25b3f0df43ed571c0", // v1.4.3
)
- .add_with(("cache", if with_rust { "bun,rust" } else { "bun" }))
- .add_with(("path", xtask_paths::runtime_path!("/nix").as_str()))
+ .add_with(("cache", "nix"))
+ .map(|step| {
+ if with_rust {
+ step.add_with((
+ "path",
+ format!(
+ "{}\n/home/runner/.cargo/registry\n/home/runner/.cargo/git",
+ vars::BUN_CACHE_VOLUME_DIR,
+ ),
+ ))
+ } else {
+ step.add_with(("path", vars::BUN_CACHE_VOLUME_DIR))
+ }
+ })
.continue_on_error(true)
}
/// The web-app composite: Nix dev shell (bun, biome, just) + `bun install`.
-/// We pass no S3 bucket; jobs that run `gen-api` follow this with
-/// [`configure_namespace_sccache`]. Requires [`setup_nix`] first.
+/// Jobs that run `gen-api` follow this with [`configure_namespace_sccache`].
+/// Requires [`setup_nix`] first.
pub fn setup_reqs_web(name: &str, playwright: bool) -> Step<Use> {
uses_local(
name,
xtask_paths::repo_dir!(".github/actions/setup-reqs-web"),
)
- .add_with(("cachix-auth-token", vars::CACHIX_AUTH_TOKEN))
.when(playwright, |step| step.add_with(("playwright", "true")))
}
@@ -352,7 +374,7 @@ pub fn mount_nix_cache_volume() -> Step<Use> {
"nscloud-cache-action",
"15799a6b54e5765f85b2aac25b3f0df43ed571c0", // v1.4.3
)
- .add_with(("path", xtask_paths::runtime_path!("/nix").as_str()))
+ .add_with(("cache", "nix"))
.continue_on_error(true)
}
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
index 8b0ee5a37f..26a1eae59f 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
@@ -77,6 +77,10 @@ pub const WEB_CI_CACHE_TAG: &str = "web-ci";
/// a different workload and runner profile.
pub const WEB_SCCACHE_NAME: &str = "web-ci";
+/// Bun's global package cache. Mounted explicitly because Bun is supplied by
+/// the Nix dev shell and is not available to Namespace's cache planner yet.
+pub const BUN_CACHE_VOLUME_DIR: &str = "/home/runner/.bun/install/cache";
+
/// Init-snapshot store for the preview job (`MACRO_STACK_SNAPSHOT_DIR`). Lives
/// on the preview cache volume for the zero-copy fast path; the workflow also
/// backs each content-addressed snapshot up to Namespace artifact storage so a
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
index 5bd563029b..b244732089 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
@@ -176,7 +176,7 @@ fn paths_filter() -> Step<Use> {
.add_with((
"filters",
format!(
- "should_run:\n{artifact_paths} - 'services/lexical-service/**'\n - '.github/actions/setup-cachix/**'\n - '.github/actions/setup-reqs-web/**'\n - '.github/workflows/web-app-check-main.yml'\napi_changed:\n - 'crates/**/*.rs'\n - 'services/**/*.rs'\n - 'tooling/xtask/**/*.rs'\n - 'Cargo.toml'\n - 'Cargo.lock'\n - 'flake.nix'\n - 'flake.lock'\n - 'apps/web/scripts/generate-api-schema.ts'\n - 'apps/web/scripts/services.ts'\n - '.github/actions/setup-cachix/**'\n - '.github/actions/setup-reqs-web/**'\n - '.github/workflows/web-app-check-main.yml'\n"
+ "should_run:\n{artifact_paths} - 'services/lexical-service/**'\n - '.github/actions/setup-nix-dev-shell/**'\n - '.github/actions/setup-reqs-web/**'\n - '.github/workflows/web-app-check-main.yml'\napi_changed:\n - 'crates/**/*.rs'\n - 'services/**/*.rs'\n - 'tooling/xtask/**/*.rs'\n - 'Cargo.toml'\n - 'Cargo.lock'\n - 'flake.nix'\n - 'flake.lock'\n - 'apps/web/scripts/generate-api-schema.ts'\n - 'apps/web/scripts/services.ts'\n - '.github/actions/setup-nix-dev-shell/**'\n - '.github/actions/setup-reqs-web/**'\n - '.github/workflows/web-app-check-main.yml'\n"
),
))
}