Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
with:
persist-credentials: false

- name: Check environment (pre-pnpm)
run: node scripts/check-environment.mjs

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271

Expand All @@ -43,6 +40,10 @@ jobs:
node-version: '22'
cache: 'pnpm'

# After toolchain is on PATH; skip node_modules until install (still fatal on git/node/pnpm).
- name: Check environment (pre-install)
run: node scripts/check-environment.mjs --skip-node-modules

- name: Install dependencies
run: pnpm install --frozen-lockfile

Expand Down
2 changes: 1 addition & 1 deletion docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Test results are available as a downloadable artifact from the workflow run.

Not a PR gate. Runs on a **daily schedule** (default branch only) and on **manual** `workflow_dispatch`:

1. Checkout (`persist-credentials: false`), `node scripts/check-environment.mjs`, setup pnpm + Node 22, `pnpm install --frozen-lockfile`, then `pnpm run check:environment` (`PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1`)
1. Checkout (`persist-credentials: false`), setup pnpm + Node 22, `node scripts/check-environment.mjs --skip-node-modules`, `pnpm install --frozen-lockfile`, then `pnpm run check:environment` (`PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1`)
2. Linux (`ubuntu-24.04`): install Electron runtime libraries (`libatk-bridge2.0-0t64`, `libgtk-3-0t64`, `libasound2t64`, …) + `xvfb`
3. `pnpm run build` (unpackaged `dist-electron` + renderer)
4. `pnpm run test:e2e` (Linux under `xvfb-run -a`; macOS/Windows plain) — Playwright launches the local Electron binary via `resolveLocalElectronBin()` with an isolated `--user-data-dir`
Expand Down
16 changes: 15 additions & 1 deletion scripts/check-environment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,16 @@ function checkLinuxDialout() {
};
}

/**
* @param {string[]} argv
* @returns {{ skipNodeModules: boolean }}
*/
export function parseCheckEnvironmentArgs(argv = process.argv.slice(2)) {
return {
skipNodeModules: argv.includes('--skip-node-modules'),
};
}

/**
* @returns {CheckResult[]}
*/
Expand Down Expand Up @@ -745,9 +755,13 @@ function printSummary(checks) {

function main() {
const platformLabel = PLATFORM_LABELS[process.platform] ?? process.platform;
const args = parseCheckEnvironmentArgs();
console.log(`Mesh Client environment check (platform: ${platformLabel})\n`);
if (args.skipNodeModules) {
console.log('(skipping node_modules check — pre-install mode)\n');
}

const checks = runChecks();
const checks = runChecks({ skipNodeModules: args.skipNodeModules });

for (const check of checks) {
for (const line of formatCheckResult(check)) {
Expand Down
13 changes: 13 additions & 0 deletions scripts/check-environment.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ import {
formatLocalActDockerNote,
evaluateContainerEngineCheck,
evaluatePlaywrightCheck,
parseCheckEnvironmentArgs,
parseVersion,
resolveExitCode,
versionGte,
} from './check-environment.mjs';

describe('check-environment parseCheckEnvironmentArgs', () => {
it('defaults skipNodeModules to false', () => {
expect(parseCheckEnvironmentArgs([])).toEqual({ skipNodeModules: false });
});

it('enables skipNodeModules for --skip-node-modules', () => {
expect(parseCheckEnvironmentArgs(['--skip-node-modules'])).toEqual({
skipNodeModules: true,
});
});
});

describe('check-environment parseVersion', () => {
it('parses v-prefixed semver strings', () => {
expect(parseVersion('v22.13.0')).toEqual({ major: 22, minor: 13, patch: 0 });
Expand Down