Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f219001
perf(ci): Benchmark building SDKs directly in test jobs
nicohrubec Nov 22, 2026
01d9713
perf(ci): Expand independent SDK build comparisons
nicohrubec Nov 22, 2026
f353c1b
perf(ci): Benchmark complete integration and browser matrices
nicohrubec Nov 22, 2026
5985f8e
perf(ci): Build SDK outputs directly in all test jobs
nicohrubec Nov 22, 2026
a700282
perf(ci): Scope local builds to each test job dependency graph
nicohrubec Nov 22, 2026
143d649
perf(ci): Include nested app dependencies and custom Nx targets
nicohrubec Nov 22, 2026
fb2d0e8
fix(ci): Build SDK dependencies for bundler compatibility tests
nicohrubec Nov 22, 2026
740d7f2
perf(ci): Cache a standalone Nx runtime for planning
nicohrubec Nov 22, 2026
ecc0b49
fix(ci): Dereference planner runtime dependencies when copying
nicohrubec Nov 22, 2026
631a666
refactor(ci): Remove obsolete shared-build setup
nicohrubec Nov 23, 2026
aee0d3f
refactor(ci): Share SDK build execution with the central build
nicohrubec Nov 23, 2026
5b5c50e
test(ci): Run full develop workload in dispatched benchmark
nicohrubec Nov 24, 2026
1a634e0
test(ci): Restore normal branch detection after benchmark
nicohrubec Nov 24, 2026
0eb874d
test(ci): Run final full-suite distributed build benchmark
nicohrubec Nov 24, 2026
d1b9296
test(ci): Remove final benchmark branch override
nicohrubec Nov 24, 2026
18db132
test(ci): Benchmark decentralized builds after merged E2E improvements
nicohrubec Nov 24, 2026
7ffc058
test(ci): Restore normal metadata after merged-changes benchmark
nicohrubec Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/actions/build-local-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Build SDK packages locally'
description: 'Restore workspace dependencies and build the SDK outputs needed by this job.'
inputs:
setup:
description: 'Set up the build Node version and restore workspace dependencies.'
default: 'true'
package-path:
description: 'Comma-separated package paths whose SDK dependencies to build; use . only for repo-wide checks.'
default: ''
targets:
description: 'Nx targets to build for the selected packages and their dependencies.'
default: 'build:transpile build:types'
runs:
using: composite
steps:
- name: Set up build Node
if: inputs.setup == 'true'
uses: ./.github/actions/setup-node
- name: Restore workspace dependencies
if: inputs.setup == 'true'
uses: ./.github/actions/install-dependencies
- name: Select SDK packages
id: projects
env:
INPUT_PACKAGE_PATH: ${{ inputs.package-path }}
run: node "$GITHUB_ACTION_PATH/select-projects.mjs" >> "$GITHUB_OUTPUT"
shell: bash
- name: Build SDK packages
env:
BUILD_PROJECTS: ${{ steps.projects.outputs.projects }}
run: |
node scripts/verify-packages-versions.js
pnpm exec nx run-many -t ${{ inputs.targets }} --projects="$BUILD_PROJECTS" --parallel=4
shell: bash
43 changes: 43 additions & 0 deletions .github/actions/build-local-sdk/select-projects.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { execFileSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';

const readPackage = directory => JSON.parse(fs.readFileSync(path.join(directory, 'package.json'), 'utf8'));
const workspaces = readPackage('.').workspaces;
const names = new Set(workspaces.map(directory => readPackage(directory).name));
const packagePath = process.env.INPUT_PACKAGE_PATH;
if (!packagePath) {
throw new Error('Select a package path, or explicitly use . for repo-wide checks.');
}
const roots = [
...new Set(
packagePath.split(',').flatMap(directory => {
if (directory === '.') {
return [...names];
}
if (workspaces.includes(directory)) {
return [readPackage(directory).name];
}
return fs.globSync('**/package.json', { cwd: directory, exclude: ['**/node_modules/**'] }).flatMap(file => {
const manifest = readPackage(path.join(directory, path.dirname(file)));
return Object.keys({ ...manifest.dependencies, ...manifest.devDependencies }).filter(name => names.has(name));
});
}),
),
];
if (!roots.length) {
throw new Error(`No workspace dependencies found for ${packagePath}`);
}

// pnpm's ... selector includes workspace dependencies, including shared test runners and build tools.
const packages = JSON.parse(
execFileSync('pnpm', [...roots.flatMap(name => ['--filter', `${name}...`]), '-r', 'list', '--depth=-1', '--json'], {
encoding: 'utf8',
}),
);
const projects = packages.map(pkg => pkg.name);
if (!projects.length) {
throw new Error(`No SDK build projects selected for ${packagePath}`);
}
process.stderr.write(`Selected ${projects.length} workspace projects for ${packagePath}: ${projects.join(', ')}\n`);
process.stdout.write(`projects=${projects.join(',')}\n`);
13 changes: 10 additions & 3 deletions .github/actions/prepare-e2e-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
github-token:
description: 'Token to download artifacts from `artifacts-run-id`. Only needed when that is set.'
default: ''
download-artifacts:
description: 'Download SDK artifacts instead of using outputs already built in this workspace.'
default: 'true'

runs:
using: 'composite'
Expand Down Expand Up @@ -57,7 +60,7 @@ runs:
uses: ./.github/actions/install-pnpm

- name: Restore SDK build and dependencies for Lambda layer
if: inputs.build-lambda-layer == 'true'
if: inputs.build-lambda-layer == 'true' && inputs.download-artifacts == 'true'
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ inputs.dependency-cache-key }}
Expand All @@ -71,6 +74,7 @@ runs:
# upload-artifact strips the path through the first `*`, so the tarballs are stored as <pkg>/*.tgz and have to be
# downloaded into packages/.
- name: Restore tarball artifacts
if: inputs.download-artifacts == 'true'
uses: actions/download-artifact@v8
with:
name: build-tarball-output
Expand All @@ -79,6 +83,7 @@ runs:
github-token: ${{ inputs.github-token }}

- name: Restore test-utils tarball artifact
if: inputs.download-artifacts == 'true'
uses: actions/download-artifact@v8
with:
name: build-test-utils-tarball-output
Expand All @@ -87,7 +92,9 @@ runs:
github-token: ${{ inputs.github-token }}

- name: Restore build layer artifacts
if: inputs.test-application == 'aws-serverless-layer' && inputs.build-lambda-layer != 'true'
if:
inputs.download-artifacts == 'true' && inputs.test-application == 'aws-serverless-layer' &&
inputs.build-lambda-layer != 'true'
uses: actions/download-artifact@v8
with:
name: build-layer-output
Expand All @@ -97,7 +104,7 @@ runs:

# The Lambda functions install the built workspace packages directly (see `src/stack.ts`).
- name: Restore build artifacts
if: inputs.test-application == 'aws-serverless'
if: inputs.download-artifacts == 'true' && inputs.test-application == 'aws-serverless'
uses: actions/download-artifact@v8
with:
name: build-output
Expand Down
34 changes: 34 additions & 0 deletions .github/actions/setup-nx-planner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Set up Nx planner'
description: 'Restores only the locked Nx runtime needed for affected-project selection.'

runs:
using: 'composite'
steps:
- name: Compute planner cache key
id: dependencies
shell: bash
run: |
node scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT"
if [ -x node_modules/.bin/nx ]; then echo 'installed=true' >> "$GITHUB_OUTPUT"; fi

- name: Restore Nx runtime
id: cache
uses: actions/cache@v6.1.0
with:
path: ${{ runner.temp }}/nx-planner
key: nx-planner-v2-${{ steps.dependencies.outputs.hash }}-${{ runner.os }}-${{ runner.arch }}

# A miss uses the regular install; develop also seeds this cache from its existing install.
- name: Install dependencies on cache miss
if: steps.cache.outputs.cache-hit != 'true' && steps.dependencies.outputs.installed != 'true'
uses: ./.github/actions/install-dependencies

- name: Package Nx runtime
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: node "$GITHUB_ACTION_PATH/package-runtime.mjs" "$RUNNER_TEMP/nx-planner"

- name: Use cached Nx runtime
if: steps.cache.outputs.cache-hit == 'true' && steps.dependencies.outputs.installed != 'true'
shell: bash
run: ln -s "$RUNNER_TEMP/nx-planner/node_modules" node_modules
19 changes: 19 additions & 0 deletions .github/actions/setup-nx-planner/package-runtime.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fs from 'node:fs';
import { execFileSync } from 'node:child_process';
import path from 'node:path';
import { createRequire } from 'node:module';

const require = createRequire(path.join(process.cwd(), 'package.json'));
const nxPackage = fs.realpathSync(require.resolve('nx/package.json'));
const destination = path.resolve(process.argv[2]);
const modules = path.join(destination, 'node_modules');

// Nx lists its runtime dependency closure directly; pnpm links it all in this directory.
const nxDependencies = path.resolve(nxPackage, '../..');
fs.rmSync(destination, { recursive: true, force: true });
fs.mkdirSync(destination, { recursive: true });
execFileSync('cp', ['-RL', nxDependencies, modules]);
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
// Nx's pnpm lockfile reader requires the install metadata, even without workspace dependencies.
fs.copyFileSync('node_modules/.modules.yaml', path.join(modules, '.modules.yaml'));
fs.mkdirSync(path.join(modules, '.bin'), { recursive: true });
fs.symlinkSync('../nx/dist/bin/nx.js', path.join(modules, '.bin/nx'));
Loading
Loading