image: node:20 variables: CI: 'true' # Main job <%= workflowName %>: interruptible: true only: - main - merge_requests script: <% if(packageManager == 'pnpm'){ %> - npm install --prefix=$HOME/.local -g pnpm@8 <% } %> <% if(packageManager == 'bun'){ %> - npm install --prefix=$HOME/.local -g bun <% } %> # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - <%= packageManagerPreInstallPrefix %> nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <%= packageManagerInstall %><% if(hasCypress){ %> - <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> - <%= packageManagerPrefix %> playwright install --with-deps<% } %><% if(!useRunMany){ %> - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}<% } %> <% for (const command of commands) { %><% if (command.comments) { %><% for (const comment of command.comments) { %> # <%- comment %><% } %><% } %><% if (command.command && !command.alwaysRun) { %> - <%= command.command %><% } %><% } %> <% const alwaysRunCommands = commands.filter(c => c.alwaysRun && c.command) %> <% if (alwaysRunCommands.length > 0) { %> after_script: <% for (const command of alwaysRunCommands) { %> - <%= command.command %> <% } %> <% } %>