ci: Use @currents/cmd OIDC for CI recording and run cancellation (#45356)

This commit is contained in:
Declan Carroll authored and GitHub committed 2026-11-27 09:48:12 +00:00
1 parent d4a9589560
commit b87d8e1d98
15 files changed
+329 -109

No files matched your search

+142 -53
View File
@@ -50,27 +50,19 @@ const resolveInputs = (workflow, callerInputs = {}) => {
/**
* Evaluates the subset of the GitHub Actions expression syntax that the step
* conditions below use: the status functions, `&&`/`||`, and `==`/`!=` against
* a string literal. Anything outside that subset throws, so a condition this
* evaluator cannot model fails the test instead of passing silently.
* conditions below use: status functions, `&&`/`||`, unary `!`, parenthesized
* grouping, `inputs.*`, `env.*`, and `==`/`!=` against string literals.
* Anything outside that subset throws, so a condition this evaluator cannot
* model fails the test instead of passing silently.
*
* @param {string} condition - the raw value of a step's `if:` key
* @param {{ inputs?: Record<string, unknown>, jobStatus?: 'success' | 'failure' | 'cancelled' }} context
* @param {{ inputs?: Record<string, unknown>, env?: Record<string, string>, jobStatus?: 'success' | 'failure' | 'cancelled' }} context
* @returns {boolean} true when the step runs, false when the runner skips it
*/
const evaluateStepCondition = (condition, { inputs = {}, jobStatus = 'success' } = {}) => {
const expression = String(condition)
.trim()
.replace(/^\$\{\{(.*)\}\}$/s, '$1')
.trim();
// The subset has no grouping, so only the zero-argument status calls may
// carry parentheses. Anything else would need precedence rules this lacks.
assert.doesNotMatch(
expression.replace(/\w+\(\)/g, ''),
/[()]/,
`step condition uses grouping this evaluator cannot model: "${expression}"`,
);
const evaluateStepCondition = (
condition,
{ inputs = {}, env = {}, jobStatus = 'success' } = {},
) => {
const value = (token) => {
const term = token.trim();
switch (term) {
@@ -99,22 +91,44 @@ const evaluateStepCondition = (condition, { inputs = {}, jobStatus = 'success' }
return inputs[input[1]];
}
const envVar = term.match(/^env\.([\w-]+)$/);
if (envVar) return env[envVar[1]] ?? '';
assert.fail(`unsupported term in step condition: "${term}"`);
};
const operand = (token) => {
const comparison = token.match(/^(.+?)(==|!=)(.+)$/s);
if (!comparison) return Boolean(value(token));
const [, left, operator, right] = comparison;
const equal = String(value(left)) === String(value(right));
return operator === '==' ? equal : !equal;
const trimmed = token.trim();
const comparison = trimmed.match(/^(.+?)(==|!=)(.+)$/s);
if (comparison) {
const [, left, operator, right] = comparison;
const equal = String(value(left)) === String(value(right));
return operator === '==' ? equal : !equal;
}
if (trimmed.startsWith('!')) return !operand(trimmed.slice(1));
return Boolean(value(trimmed));
};
// `&&` binds tighter than `||`, and the subset has no parentheses to nest.
return expression
.split('||')
.some((disjunct) => disjunct.split('&&').every((conjunct) => operand(conjunct)));
const evaluateFlat = (expr) =>
expr
.split('||')
.some((disjunct) => disjunct.split('&&').every((conjunct) => operand(conjunct)));
let expression = String(condition)
.trim()
.replace(/^\$\{\{(.*)\}\}$/s, '$1')
.trim();
while (/(?<!\w)\(([^()]+)\)/.test(expression)) {
expression = expression.replace(/(?<!\w)\(([^()]+)\)/, (_, inner) =>
String(evaluateFlat(inner)),
);
}
assert.doesNotMatch(
expression.replace(/\w+\(\)/g, ''),
/[()]/,
`step condition has unmatched parentheses: "${expression}"`,
);
return evaluateFlat(expression);
};
describe('evaluateStepCondition', () => {
@@ -135,6 +149,24 @@ describe('evaluateStepCondition', () => {
assert.equal(evaluateStepCondition("${{ inputs.key != 'abc' }}", { inputs }), false);
});
it('evaluates grouping, unary negation, and env variables', () => {
const inputs = { skip: true };
assert.equal(
evaluateStepCondition("${{ always() && (!inputs.skip || env.KEY == '') }}", {
inputs,
env: {},
}),
true,
);
assert.equal(
evaluateStepCondition("${{ always() && (!inputs.skip || env.KEY == '') }}", {
inputs,
env: { KEY: 'crnts_ci_abc' },
}),
false,
);
});
it('rejects a term it cannot model', () => {
assert.throws(() => evaluateStepCondition('github.event_name'), /unsupported term/);
});
@@ -466,63 +498,120 @@ describe('test-e2e-reusable.yml', () => {
const workflow = workflowFile('test-e2e-reusable.yml');
const shardUpload = stepNamed(workflow, 'test', 'Upload Shard Artifacts');
const a11yUpload = stepNamed(workflow, 'test', 'Upload Accessibility Report');
const cancelStep = stepNamed(workflow, 'test', 'Cancel Currents run if workflow is cancelled');
const revokeStep = stepNamed(workflow, 'test', 'Revoke Currents OIDC credential');
describe('currents-record-key input', () => {
it('is an optional string that defaults to an empty value', () => {
const { 'currents-record-key': recordKey } = triggersOf(workflow).workflow_call.inputs;
describe('skip-shard-upload-when-recording input', () => {
it('is an optional boolean that defaults to false', () => {
const { 'skip-shard-upload-when-recording': skipUpload } =
triggersOf(workflow).workflow_call.inputs;
assert.ok(recordKey, 'workflow does not declare a currents-record-key input');
assert.equal(recordKey.type, 'string');
assert.equal(recordKey.required ?? false, false);
assert.equal(recordKey.default, '');
assert.ok(skipUpload, 'workflow does not declare a skip-shard-upload-when-recording input');
assert.equal(skipUpload.type, 'boolean');
assert.equal(skipUpload.required ?? false, false);
assert.equal(skipUpload.default, false);
});
});
describe('shard artifact upload', () => {
it('runs when the caller passes no record key', () => {
it('runs by default even when Currents is recording', () => {
const inputs = resolveInputs(workflow);
for (const jobStatus of ['success', 'failure']) {
assert.equal(
evaluateStepCondition(shardUpload.if, { inputs, jobStatus }),
true,
`shard upload must run on a ${jobStatus} job when no record key is passed`,
);
for (const env of [{}, { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' }]) {
for (const jobStatus of ['success', 'failure']) {
assert.equal(
evaluateStepCondition(shardUpload.if, { inputs, env, jobStatus }),
true,
`shard upload must run by default on a ${jobStatus} job`,
);
}
}
});
it('runs when the caller passes an empty record key', () => {
const inputs = resolveInputs(workflow, { 'currents-record-key': '' });
it('runs when skip-shard-upload-when-recording is true but CURRENTS_RECORD_KEY is empty', () => {
const inputs = resolveInputs(workflow, { 'skip-shard-upload-when-recording': true });
assert.equal(evaluateStepCondition(shardUpload.if, { inputs }), true);
for (const env of [{}, { CURRENTS_RECORD_KEY: '' }]) {
for (const jobStatus of ['success', 'failure']) {
assert.equal(
evaluateStepCondition(shardUpload.if, { inputs, env, jobStatus }),
true,
`shard upload must run on a ${jobStatus} job when not recording`,
);
}
}
});
it('is skipped when the caller passes a record key', () => {
const inputs = resolveInputs(workflow, { 'currents-record-key': 'record-key-value' });
it('is skipped when skip-shard-upload-when-recording is true and Currents is recording', () => {
const inputs = resolveInputs(workflow, { 'skip-shard-upload-when-recording': true });
const env = { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' };
for (const jobStatus of ['success', 'failure']) {
assert.equal(
evaluateStepCondition(shardUpload.if, { inputs, jobStatus }),
evaluateStepCondition(shardUpload.if, { inputs, env, jobStatus }),
false,
`shard upload must be skipped on a ${jobStatus} job when a record key is passed`,
`shard upload must be skipped on a ${jobStatus} job when recording`,
);
}
});
});
describe('accessibility report upload', () => {
it('is not gated on the record key', () => {
assert.doesNotMatch(String(a11yUpload.if), /currents-record-key/);
it('is not gated on Currents recording', () => {
assert.doesNotMatch(
String(a11yUpload.if),
/skip-shard-upload-when-recording|CURRENTS_RECORD_KEY/,
);
});
it('runs on a failed job whether or not a record key is passed', () => {
for (const callerInputs of [{}, { 'currents-record-key': 'record-key-value' }]) {
it('runs on a failed job whether or not Currents is recording', () => {
for (const callerInputs of [{}, { 'skip-shard-upload-when-recording': true }]) {
const inputs = resolveInputs(workflow, callerInputs);
assert.equal(evaluateStepCondition(a11yUpload.if, { inputs, jobStatus: 'failure' }), true);
assert.equal(
evaluateStepCondition(a11yUpload.if, {
inputs,
env: { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' },
jobStatus: 'failure',
}),
true,
);
}
});
});
describe('Currents cancellation and revocation', () => {
it('cancels using CURRENTS_RECORD_KEY before revoking the OIDC credential', () => {
const steps = workflow.jobs.test.steps;
assert.ok(steps.indexOf(cancelStep) < steps.indexOf(revokeStep));
assert.equal(
evaluateStepCondition(cancelStep.if, {
env: { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' },
jobStatus: 'cancelled',
}),
true,
);
assert.equal(
evaluateStepCondition(cancelStep.if, { env: {}, jobStatus: 'cancelled' }),
false,
);
assert.equal(
evaluateStepCondition(cancelStep.if, {
env: { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' },
jobStatus: 'success',
}),
false,
);
assert.equal(
evaluateStepCondition(revokeStep.if, {
env: { CURRENTS_RECORD_KEY: 'crnts_ci_record-key' },
jobStatus: 'cancelled',
}),
true,
);
assert.equal(evaluateStepCondition(revokeStep.if, { env: {}, jobStatus: 'success' }), false);
});
});
});
describe('unpublished package handling', () => {
+10 -2
View File
@@ -59,7 +59,6 @@ jobs:
affected_packages: ${{ steps.affected-packages.outputs.list }}
lockfile_impact: ${{ steps.affected-packages.outputs.lockfile-impact }}
changed_files: ${{ steps.ci-filter.outputs.changed-files }}
currents_record_key: ${{ secrets.CURRENTS_RECORD_KEY != '' && 'present' || '' }}
steps:
- uses: useblacksmith/checkout@bcec731f1eb1367240608d1c889a75b96db6ec53 # v1.5.0
with:
@@ -532,6 +531,9 @@ jobs:
needs.e2e-matrix.result == 'success' &&
needs.install-and-build.outputs.run_e2e == 'true' &&
needs.e2e-matrix.outputs.skip_tests != 'true'
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
branch: ${{ needs.install-and-build.outputs.commit_sha }}
@@ -540,7 +542,7 @@ jobs:
workers: '1'
pre-generated-matrix: ${{ needs.e2e-matrix.outputs.matrix }}
artifact-prefix: e2e
currents-record-key: ${{ needs.install-and-build.outputs.currents_record_key }}
skip-shard-upload-when-recording: true
secrets: inherit
# Engine v2 parity: runs the `@engine:*` specs against a main that routes
@@ -557,6 +559,9 @@ jobs:
|| contains(github.event.pull_request.labels.*.name, 'force-engine-e2e')) &&
github.event.pull_request.head.repo.fork != true &&
github.event_name != 'merge_group'
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
branch: ${{ needs.install-and-build.outputs.commit_sha }}
@@ -615,6 +620,9 @@ jobs:
(needs.install-and-build.outputs.e2e_performance == 'true' ||
contains(github.event.pull_request.labels.*.name, 'run-perf-tests')) &&
github.event.pull_request.head.repo.fork != true
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-performance-reusable.yml
secrets: inherit
+30 -29
View File
@@ -164,6 +164,7 @@ jobs:
permissions:
contents: read
packages: read
id-token: write
strategy:
fail-fast: false
matrix:
@@ -234,6 +235,14 @@ jobs:
with:
build-command: pnpm turbo run build --filter=n8n-workflow...
- name: Authenticate with Currents
if: vars.CURRENTS_OIDC_POLICY_ID != ''
env:
CURRENTS_OIDC_POLICY_ID: ${{ vars.CURRENTS_OIDC_POLICY_ID }}
run: |
KEY=$(pnpm --silent --filter=n8n-playwright exec currents ci auth get-record-key --oidc-provider github-actions)
echo "CURRENTS_RECORD_KEY=$KEY" >> "$GITHUB_ENV"
- name: Login to GHCR
uses: ./.github/actions/docker-registry-login
with:
@@ -254,7 +263,6 @@ jobs:
env:
SPECS: ${{ matrix.specs }}
REDIS_IMAGE: ${{ matrix.redis_image }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
N8N_LICENSE_ACTIVATION_KEY: ${{ secrets.N8N_LICENSE_ACTIVATION_KEY }}
N8N_LICENSE_CERT: ${{ secrets.N8N_LICENSE_CERT }}
run: |
@@ -277,19 +285,12 @@ jobs:
if-no-files-found: ignore
- name: Cancel Currents run if workflow is cancelled
if: cancelled()
env:
CURRENTS_API_KEY: ${{ secrets.CURRENTS_API_KEY }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
run: |
if [ -n "$CURRENTS_API_KEY" ]; then
curl --location --request PUT \
"https://api.currents.dev/v1/runs/cancel-ci/github" \
--header "Authorization: Bearer $CURRENTS_API_KEY" \
--header "Content-Type: application/json" \
--data "{\"githubRunId\": \"${GITHUB_RUN_ID}\", \"githubRunAttempt\": \"${GITHUB_RUN_ATTEMPT}\"}"
fi
if: ${{ cancelled() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents run cancel || true
- name: Revoke Currents OIDC credential
if: ${{ always() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents ci auth revoke || true
upgrade:
name: 3.x · amd64 · upgrade
@@ -300,6 +301,7 @@ jobs:
permissions:
contents: read
packages: read
id-token: write
env:
NODE_OPTIONS: '--max-old-space-size=6144'
DEPLOYMENT_CHANNEL: ${{ needs.resolve.outputs.channel }}
@@ -323,6 +325,14 @@ jobs:
with:
build-command: pnpm turbo run build --filter=n8n-workflow...
- name: Authenticate with Currents
if: vars.CURRENTS_OIDC_POLICY_ID != ''
env:
CURRENTS_OIDC_POLICY_ID: ${{ vars.CURRENTS_OIDC_POLICY_ID }}
run: |
KEY=$(pnpm --silent --filter=n8n-playwright exec currents ci auth get-record-key --oidc-provider github-actions)
echo "CURRENTS_RECORD_KEY=$KEY" >> "$GITHUB_ENV"
- name: Login to GHCR
uses: ./.github/actions/docker-registry-login
with:
@@ -335,8 +345,6 @@ jobs:
docker pull --quiet "$TEST_IMAGE_N8N_UPGRADE_FROM"
- name: Run upgrade deployment cell
env:
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
run: |
set -euo pipefail
pnpm --filter=n8n-playwright test:deployment tests/deployment/upgrade-2x-to-3x.spec.ts
@@ -353,16 +361,9 @@ jobs:
if-no-files-found: ignore
- name: Cancel Currents run if workflow is cancelled
if: cancelled()
env:
CURRENTS_API_KEY: ${{ secrets.CURRENTS_API_KEY }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
run: |
if [ -n "$CURRENTS_API_KEY" ]; then
curl --location --request PUT \
"https://api.currents.dev/v1/runs/cancel-ci/github" \
--header "Authorization: Bearer $CURRENTS_API_KEY" \
--header "Content-Type: application/json" \
--data "{\"githubRunId\": \"${GITHUB_RUN_ID}\", \"githubRunAttempt\": \"${GITHUB_RUN_ATTEMPT}\"}"
fi
if: ${{ cancelled() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents run cancel || true
- name: Revoke Currents OIDC credential
if: ${{ always() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents ci auth revoke || true
@@ -59,6 +59,9 @@ jobs:
e2e:
name: E2E (coverage)
needs: [prepare-docker, generate-matrix]
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
test-mode: docker-artifact
@@ -17,6 +17,9 @@ jobs:
benchmark:
needs: [prepare-docker]
name: ${{ matrix.lane }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
@@ -83,6 +83,9 @@ jobs:
e2e:
name: E2E on the pc twin
needs: [prepare-docker, generate-matrix]
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
test-mode: docker-artifact
@@ -17,6 +17,9 @@ jobs:
build-and-test-performance:
needs: [prepare-docker]
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
test-mode: docker-artifact
@@ -29,6 +32,9 @@ jobs:
idle-memory-baselines:
needs: [prepare-docker]
permissions:
contents: read
id-token: write
uses: ./.github/workflows/test-e2e-reusable.yml
with:
test-mode: docker-artifact
+22 -19
View File
@@ -37,11 +37,11 @@ on:
required: false
default: 'nHHLA5'
type: string
currents-record-key:
description: 'Currents record key. When set, Currents keeps the run artifacts and the shards do not upload their own.'
skip-shard-upload-when-recording:
description: 'Skip uploading shard artifacts when Currents is recording the run.'
required: false
default: ''
type: string
default: false
type: boolean
pre-generated-matrix:
description: 'Pre-generated shard matrix JSON. Defaults to 1 shard; multi-shard callers pass their own.'
required: false
@@ -82,6 +82,7 @@ jobs:
timeout-minutes: ${{ inputs.timeout-minutes }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
@@ -151,6 +152,14 @@ jobs:
echo "args=$MATRIX_SPECS" >> "$GITHUB_OUTPUT"
fi
- name: Authenticate with Currents
if: steps.shard-args.outputs.skip != 'true' && vars.CURRENTS_OIDC_POLICY_ID != '' && github.event.pull_request.head.repo.fork != true
env:
CURRENTS_OIDC_POLICY_ID: ${{ vars.CURRENTS_OIDC_POLICY_ID }}
run: |
KEY=$(pnpm --silent --filter=n8n-playwright exec currents ci auth get-record-key --oidc-provider github-actions)
echo "CURRENTS_RECORD_KEY=$KEY" >> "$GITHUB_ENV"
- name: Run Tests
if: steps.shard-args.outputs.skip != 'true'
run: |
@@ -170,7 +179,6 @@ jobs:
WORKERS: ${{ env.PLAYWRIGHT_WORKERS }}
SHARD_ARGS: ${{ steps.shard-args.outputs.args }}
# Args for actual test command runner
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
QA_METRICS_WEBHOOK_URL: ${{ secrets.QA_METRICS_WEBHOOK_URL }}
QA_METRICS_WEBHOOK_USER: ${{ secrets.QA_METRICS_WEBHOOK_USER }}
QA_METRICS_WEBHOOK_PASSWORD: ${{ secrets.QA_METRICS_WEBHOOK_PASSWORD }}
@@ -187,10 +195,10 @@ jobs:
# so a local run stays quiet unless it is asked for.
PLAYWRIGHT_A11Y_REPORT: '1'
# Currents already keeps these artifacts for the runs it records, so the
# shard upload is only needed when no record key is passed.
# Currents already keeps these artifacts for the runs it records, so callers
# that do not need shard artifacts can skip uploading them when recording.
- name: Upload Shard Artifacts
if: ${{ always() && inputs.currents-record-key == '' }}
if: ${{ always() && (!inputs.skip-shard-upload-when-recording || env.CURRENTS_RECORD_KEY == '') }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ inputs.artifact-prefix }}-shard-${{ matrix.shard }}
@@ -220,14 +228,9 @@ jobs:
if-no-files-found: ignore
- name: Cancel Currents run if workflow is cancelled
if: ${{ cancelled() }}
env:
CURRENTS_API_KEY: ${{ secrets.CURRENTS_API_KEY }}
run: |
if [ -n "$CURRENTS_API_KEY" ]; then
curl --location --request PUT \
"https://api.currents.dev/v1/runs/cancel-ci/github" \
--header "Authorization: Bearer $CURRENTS_API_KEY" \
--header "Content-Type: application/json" \
--data "{\"githubRunId\": \"${{ github.run_id }}\", \"githubRunAttempt\": \"${{ github.run_attempt }}\"}"
fi
if: ${{ cancelled() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents run cancel || true
- name: Revoke Currents OIDC credential
if: ${{ always() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents ci auth revoke || true
+15 -1
View File
@@ -21,8 +21,10 @@ jobs:
needs: prepare-docker
runs-on: ${{ vars.RUNNER_PROVIDER == 'github' && 'ubuntu-latest' || 'blacksmith-2vcpu-ubuntu-2204' }}
timeout-minutes: 20
permissions:
contents: read
id-token: write
env:
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_PROJECT_ID: 'nHHLA5'
CURRENTS_CI_BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}-images
QA_METRICS_WEBHOOK_URL: ${{ secrets.QA_METRICS_WEBHOOK_URL }}
@@ -37,6 +39,14 @@ jobs:
with:
build-command: pnpm turbo run build --filter=@n8n/utils...
- name: Authenticate with Currents
if: vars.CURRENTS_OIDC_POLICY_ID != ''
env:
CURRENTS_OIDC_POLICY_ID: ${{ vars.CURRENTS_OIDC_POLICY_ID }}
run: |
KEY=$(pnpm --silent --filter=n8n-playwright exec currents ci auth get-record-key --oidc-provider github-actions)
echo "CURRENTS_RECORD_KEY=$KEY" >> "$GITHUB_ENV"
- name: Load images from cache
uses: ./.github/actions/load-n8n-docker
@@ -71,3 +81,7 @@ jobs:
packages/quality/efficiency/playwright-report/
retention-days: 7
if-no-files-found: ignore
- name: Revoke Currents OIDC credential
if: ${{ always() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents ci auth revoke || true
+15 -5
View File
@@ -16,9 +16,6 @@ on:
ENCRYPTION_KEY:
description: 'Encryption key for n8n operations.'
required: true
CURRENTS_RECORD_KEY:
description: 'Currents record key for test reporting. Empty on fork PRs.'
required: false
env:
NODE_OPTIONS: --max-old-space-size=3072
@@ -27,6 +24,9 @@ jobs:
run_workflow_tests:
name: Run Workflow Tests with Snapshots
runs-on: blacksmith-2vcpu-ubuntu-2204
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -36,6 +36,14 @@ jobs:
- name: Set up Environment
uses: ./.github/actions/setup-nodejs
- name: Authenticate with Currents
if: vars.CURRENTS_OIDC_POLICY_ID != ''
env:
CURRENTS_OIDC_POLICY_ID: ${{ vars.CURRENTS_OIDC_POLICY_ID }}
run: |
KEY=$(pnpm --silent --filter=n8n-playwright exec currents ci auth get-record-key --oidc-provider github-actions)
echo "CURRENTS_RECORD_KEY=$KEY" >> "$GITHUB_ENV"
- name: Set up Workflow Tests
run: pnpm --filter=n8n-playwright test:workflows:setup
env:
@@ -44,12 +52,14 @@ jobs:
- name: Run Workflow Tests
run: pnpm --filter=n8n-playwright test:workflows --workers 4
env:
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_PROJECT_ID: 'mpLFH9'
- name: Run Workflow Schema Tests
if: ${{ inputs.compare_schemas == 'true' }}
run: pnpm --filter=n8n-playwright test:workflows:schema
env:
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_PROJECT_ID: 'mpLFH9'
- name: Revoke Currents OIDC credential
if: ${{ always() && env.CURRENTS_RECORD_KEY != '' }}
run: pnpm --filter=n8n-playwright exec currents ci auth revoke || true
@@ -16,6 +16,10 @@ on:
type: string
default: 'master'
permissions:
contents: read
id-token: write
jobs:
run_workflow_tests:
name: Run Workflow Tests
+2
View File
@@ -222,6 +222,8 @@ const config: KnipConfig = {
'n8n-core',
// Manual `pnpm exec playwright-cli` runs; .gitignore lists its .playwright-cli dir.
'@playwright/cli',
// Invoked in CI workflows via `pnpm --filter=n8n-playwright exec currents`.
'@currents/cmd',
],
}),
},
@@ -67,6 +67,7 @@
"devDependencies": {
"@anthropic-ai/sdk": "0.91.1",
"@axe-core/playwright": "^4.13.0",
"@currents/cmd": "catalog:e2e",
"@currents/playwright": "catalog:e2e",
"@n8n/eslint-config": "workspace:*",
"@n8n/oxlint-config": "workspace:*",
+72
View File
@@ -864,6 +864,9 @@ catalogs:
specifier: 3.23.3
version: 3.23.3
e2e:
'@currents/cmd':
specifier: 3.4.0
version: 3.4.0
'@currents/playwright':
specifier: ^2.0.0
version: 2.0.0
@@ -10464,6 +10467,9 @@ importers:
'@axe-core/playwright':
specifier: ^4.13.0
version: 4.13.0(playwright-core@1.62.1)
'@currents/cmd':
specifier: catalog:e2e
version: 3.4.0(supports-color@8.1.1)
'@currents/playwright':
specifier: catalog:e2e
version: 2.0.0(bufferutil@4.0.9)(supports-color@8.1.1)(utf-8-validate@5.0.10)
@@ -12369,6 +12375,11 @@ packages:
peerDependencies:
commander: ~13.1.0
'@commander-js/extra-typings@14.0.0':
resolution: {integrity: sha512-hIn0ncNaJRLkZrxBIp5AsW/eXEHNKYQBh0aPdoUqNgD+Io3NIykQqpKFyKcuasZhicGaEZJX/JBSIkZ4e5x8Dg==}
peerDependencies:
commander: ~14.0.0
'@confluentinc/kafka-javascript@1.9.1':
resolution: {integrity: sha512-Qc7IZGSiWb9PVcfGwhMDmVcn0fj4V2jZjJ7r1ObNdnu1JSFY1yMZvINS4QY9dAI00S7Ng6EE2zIaEQ7UrVDrPw==}
engines: {node: '>=18.0.0'}
@@ -12404,14 +12415,26 @@ packages:
resolution: {integrity: sha512-6V0+8vw/GmH92URQ/Ki12FPhoB3nqaQUJE+5xgbFbB5ok0OXYK5jCQsQQoyR3BzCddHsCpyCFRnIcI1PSOVYkQ==}
engines: {node: '>=14'}
'@currents/cmd@3.4.0':
resolution: {integrity: sha512-/s5wAN5X1UX1bBVlgiwP+wNjeeSR67o6sJtjA3wjJ16RjcdkpeVbCXjajAfQTPKuLSiUNcwlzS+rGcsa47PC3g==}
engines: {node: '>=22.13'}
hasBin: true
'@currents/commit-info@1.0.1-beta.0':
resolution: {integrity: sha512-gkn8E3UC+F4/fCla7QAGMGgGPzxZUL9bU9+4I+KZf9PtCU3DdQCdy7a+er2eg4ewfUzZ2Ic1HcfnHuPkuLPKIw==}
engines: {node: '>=6'}
'@currents/commit-info@3.0.0':
resolution: {integrity: sha512-eGc3f816w4fvqCQaKJRYOWohX7HS1TleE10qOfEQa7jh34jHfgE0vmbg+vcC0wfW92j+iJaN4kgsbaFNMP8VTQ==}
'@currents/playwright@2.0.0':
resolution: {integrity: sha512-ai/qoXb0i0WU0tO6JJWwEJvPcC72Ldl7sRlkgbHiEiHTiaDBt1d09rdDBvwcS3p/TtqSZ4C3GDsk9dovLd5hZg==}
hasBin: true
'@currents/rules@0.1.0':
resolution: {integrity: sha512-VmNYE2vsFdHCYAvNCDirjuOGV8AYiFNgyTbS1QitN9k8Kaqv7vovEi70/dBf2g/pSRfwL2vkxqMN8ddyXMWAag==}
engines: {node: '>=18.17'}
'@dabh/diagnostics@2.0.3':
resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==}
@@ -27909,6 +27932,13 @@ packages:
yauzl@2.10.0:
resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
yauzl@3.4.0:
resolution: {integrity: sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw==}
engines: {node: '>=12'}
yazl@3.3.1:
resolution: {integrity: sha512-BbETDVWG+VcMUle37k5Fqp//7SDOK2/1+T7X8TD96M3D9G8jK5VLUdQVdVjGi8im7FGkazX7kk5hkU8X4L5Bng==}
yjs@13.6.29:
resolution: {integrity: sha512-kHqDPdltoXH+X4w1lVmMtddE3Oeqq48nM40FD5ojTd8xYhQpzIDcfE2keMSU5bAgRPJBe225WTUdyUgj1DtbiQ==}
engines: {node: '>=16.0.0', npm: '>=8.0.0'}
@@ -30874,6 +30904,10 @@ snapshots:
dependencies:
commander: 13.1.0
'@commander-js/extra-typings@14.0.0(commander@14.0.3)':
dependencies:
commander: 14.0.3
'@confluentinc/kafka-javascript@1.9.1(patch_hash=c597d3e3d9d6d0d33588b7dc1e88d55f270ba155721aad464bd7fb03e28f5003)(encoding@0.1.13)(supports-color@8.1.1)':
dependencies:
'@mapbox/node-pre-gyp': 2.0.3(encoding@0.1.13)(supports-color@8.1.1)
@@ -30902,6 +30936,25 @@ snapshots:
'@ctrl/tinycolor@4.3.0': {}
'@currents/cmd@3.4.0(supports-color@8.1.1)':
dependencies:
'@commander-js/extra-typings': 14.0.0(commander@14.0.3)
'@currents/commit-info': 3.0.0(supports-color@8.1.1)
'@currents/rules': 0.1.0
commander: 14.0.3
debug: 4.4.3(supports-color@8.1.1)
dotenv: 17.4.2
lodash: 4.18.1(patch_hash=0384abb0bf57b0811e09219dbce0b926741d818285ee77526ad4cb75a60b87a1)
proxy-from-env: 2.1.0
semver: 7.7.3
tinyglobby: 0.2.17
undici: 7.30.1
xml2js: 0.6.2(patch_hash=3efbf117e53f23a62e3e3faa4d02fef8e73d5359bfd50a24e94d32d6f1257bf3)
yauzl: 3.4.0
yazl: 3.3.1
transitivePeerDependencies:
- supports-color
'@currents/commit-info@1.0.1-beta.0(supports-color@8.1.1)':
dependencies:
bluebird: 3.5.5
@@ -30913,6 +30966,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@currents/commit-info@3.0.0(supports-color@8.1.1)':
dependencies:
debug: 4.4.3(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
'@currents/playwright@2.0.0(bufferutil@4.0.9)(supports-color@8.1.1)(utf-8-validate@5.0.10)':
dependencies:
'@babel/code-frame': 7.29.7
@@ -30955,6 +31014,11 @@ snapshots:
- supports-color
- utf-8-validate
'@currents/rules@0.1.0':
dependencies:
lodash: 4.18.1(patch_hash=0384abb0bf57b0811e09219dbce0b926741d818285ee77526ad4cb75a60b87a1)
safe-regex2: 5.1.1
'@dabh/diagnostics@2.0.3':
dependencies:
colorspace: 1.1.4
@@ -48835,6 +48899,14 @@ snapshots:
buffer-crc32: 0.2.13
fd-slicer: 1.1.0
yauzl@3.4.0:
dependencies:
pend: 1.2.0
yazl@3.3.1:
dependencies:
buffer-crc32: 1.0.0
yjs@13.6.29:
dependencies:
lib0: 0.2.119
+1
View File
@@ -326,6 +326,7 @@ catalogMode: strict
catalogs:
e2e:
'@currents/cmd': 3.4.0
'@currents/playwright': ^2.0.0
'@playwright/cli': 0.1.0
'@playwright/test': 1.62.1