/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/ci.yml
264 строки
10 KB
AI-JamesHenry
feat!: support node ^22.13.0 || ^24.0.0 || ^26.0.0, ship lerna as ESM-only (#4390)
14 июл 2026, 11:38
Не верифицирован
14 июл 2026, 11:38
a148ba2
Код
Авторство
О чём код?
name: CI on: push: branches: - main - next pull_request: types: [assigned, opened, synchronize, reopened, labeled] concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.ref }} cancel-in-progress: true env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} NX_VERBOSE_LOGGING: false # Minimal permissions by default permissions: contents: read jobs: esm-compat-node-floor: name: ESM compatibility - Node 22.13.0 runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Install minimum supported Node version and dependencies uses: ./.github/actions/install-node-and-dependencies with: node-version: 22.13.0 - name: Test the published package entrypoints run: npx nx test lerna --skip-nx-cache main: name: Nx Cloud - Main Job runs-on: ubuntu-latest env: NX_CI_EXECUTION_ENV: "linux" steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 - uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4 - name: Start Nx Cloud CI Run - Linux run: npx nx-cloud start-ci-run --stop-agents-after="run-e2e-tests-ci" - name: Install primary node version (see volta config in package.json) and dependencies uses: ./.github/actions/install-node-and-dependencies - name: Run parallel distributed tasks uses: jameshenry/parallel-bash-commands@943dfd1eebfab8bbf19782c47a85c9ca7e8d245c # v1 with: cmd1: npx nx-cloud record -- npx nx format:check cmd2: npx nx run-many -t build --parallel=3 cmd3: npx nx run-many -t lint --parallel=3 cmd4: npx nx run-many -t test --parallel=3 --maxWorkers=2 cmd5: npx nx run integration:integration --maxWorkers=2 # e2e tests for everything except the primary task runner (atomized per spec file) - run: PUBLISHED_VERSION=999.9.9-e2e.0 npx nx run-many -t run-e2e-tests-ci --parallel=1 - name: Run Nx Cloud Self-Healing CI if: ${{ always() }} run: npx nx-cloud fix-ci - name: Stop all running agents # It's important that we always run this step, otherwise in the case of any failures in preceding non-Nx steps, the agents will keep running and waste billable minutes if: ${{ always() }} run: npx nx-cloud stop-all-agents agents: name: Nx Cloud - Agent ${{ matrix.agent }} runs-on: ubuntu-latest env: NX_CI_EXECUTION_ENV: "linux" strategy: matrix: agent: [1, 2, 3, 4, 5, 6, 7, 8] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Configure git metadata run: | git config --global user.email test@example.com git config --global user.name "Tester McPerson" # - name: Generate and configure GPG for signing commits and tags in E2E tests # run: | # # Generate a GPG key for test@example.com and store the output from stderr # GPG_OUTPUT=$(echo "Key-Type: default # Key-Length: 2048 # Subkey-Type: default # Subkey-Length: 2048 # Name-Real: Tester McPerson # Name-Email: test@example.com # Expire-Date: 0 # %no-protection" | gpg --pinentry-mode loopback --batch --generate-key 2>&1) # # Find and extract the revocation file path from sdterr # REVOCATION_FILE=$(echo "$GPG_OUTPUT" | grep '.rev' | tr '\n' ' ' | awk -F "'" '{print $4}') # # Get the GPG key ID and the full fingerprint # export GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2) # export GPG_FULL_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep "$GPG_KEY_ID" | grep -v "sec" | awk '{print $1}' | cut -d'/' -f2) # # Export fingerprint and the path to the revocation file to GITHUB_ENV # # This allows the last step in this job to revoke and delete the key # echo "GPG_FULL_KEY_ID=$GPG_FULL_KEY_ID" >> $GITHUB_ENV # echo "REVOCATION_FILE=$REVOCATION_FILE" >> $GITHUB_ENV # # Setup git signing for commits and tags # git config commit.gpgsign true # git config tag.gpgsign true # git config --global user.signingkey $GPG_KEY_ID - name: Install primary node version (see volta config in package.json) and dependencies uses: ./.github/actions/install-node-and-dependencies - name: Start Nx Agent ${{ matrix.agent }} run: npx nx-cloud start-agent env: NX_AGENT_NAME: ${{ matrix.agent }} - name: Run Nx Cloud Self-Healing CI if: ${{ always() }} run: npx nx-cloud fix-ci # - name: Revoke and delete GPG key # # It's important that we always run this step, otherwise the key will remain active if any of the steps above fail # if: ${{ always() }} # run: | # # As instructed in the text of revocation file, there is a colon that needs to be removed manually # sed -i "s/:-----BEGIN PGP PUBLIC KEY BLOCK-----/-----BEGIN PGP PUBLIC KEY BLOCK-----/" $REVOCATION_FILE # # Revoke the key and delete it # gpg --yes --import $REVOCATION_FILE # gpg --batch --yes --delete-secret-and-public-key $GPG_FULL_KEY_ID windows-main: name: Nx Cloud - Windows Main Job runs-on: windows-latest env: NX_CI_EXECUTION_ENV: "windows" LERNA_OS_TYPE: windows # Set the temp directory to a short dir without username in it otherwise import command specs have a problem because of different paths on windows agents TEMP: C:\temp TMP: C:\temp steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Start Nx Cloud CI Run - Windows run: npx nx-cloud start-ci-run --stop-agents-after="test" - name: Install primary node version (see volta config in package.json) and dependencies uses: ./.github/actions/install-node-and-dependencies - name: Run parallel distributed unit and integration tests on windows shell: bash # From old maintainer regarding integration tests: "import is NOT TESTED in windows because pain and suffering" run: | pids=() npx nx run integration:integration --maxWorkers=2 & pids+=($!) # Specs currently failing on windows are skipped via a platform check # in libs/core/vitest.config.ts (--exclude cannot be used here because # nx interprets it as project exclusion instead of forwarding it) npx nx run-many -t test --parallel=3 --maxWorkers=2 --testTimeout=60000 & pids+=($!) for pid in "${pids[@]}"; do wait "$pid" done - name: Stop all running agents for Nx Run Group # It's important that we always run this step, otherwise in the case of any failures in preceding non-Nx steps, the agents will keep running and waste billable minutes if: ${{ always() }} run: npx nx-cloud stop-all-agents windows-agents: name: Nx Cloud - Windows Agent ${{ matrix.agent }} runs-on: windows-latest strategy: matrix: agent: [1, 2, 3, 4, 5, 6, 7, 8] env: NX_CI_EXECUTION_ENV: "windows" LERNA_OS_TYPE: windows # Set the temp directory to a short dir without containing username, otherwise import command specs have a problem because of different paths on windows agents TEMP: C:\temp TMP: C:\temp steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - name: Configure git metadata run: | git config --global user.email test@example.com git config --global user.name "Tester McPerson" - name: Install primary node version (see volta config in package.json) and dependencies uses: ./.github/actions/install-node-and-dependencies - name: Start Nx Agent ${{ matrix.agent }} run: npx nx-cloud start-agent env: NX_AGENT_NAME: ${{ matrix.agent }} # Isolated e2e tests for the task runner which become too flaky if nested through further node child processes task-runner-e2e: name: Task Runner E2E runs-on: ubuntu-latest env: # Silently disable nx cloud for task runner e2e (using NX_NO_CLOUD produces a warning log) NX_CLOUD_ACCESS_TOKEN: "" NX_CI_EXECUTION_ENV: "linux" NX_CLOUD_DISTRIBUTED_EXECUTION: false steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4 - name: Configure git metadata run: | git config --global user.email test@example.com git config --global user.name "Tester McPerson" - name: Enable corepack run: corepack enable shell: bash - name: Install dependencies run: npm ci shell: bash - name: Check if e2e-run-task-runner is affected id: check_affected run: | IS_AFFECTED_STR=$(npx nx show projects --json | jq 'any(. | contains("e2e-run-task-runner"))') IS_AFFECTED=$([[ $IS_AFFECTED_STR == 'true' ]] && echo 'true' || echo '') echo "is_affected=$IS_AFFECTED" >> $GITHUB_OUTPUT shell: bash - name: Prepare e2e tests for task-runner if: ${{ steps.check_affected.outputs.is_affected }} run: npx nx prepare-for-e2e e2e-run-task-runner --no-cloud shell: bash - name: Run e2e tests for task-runner if: ${{ steps.check_affected.outputs.is_affected }} run: | # We do not want the automatic Github Actions grouping to be applied to the e2e tests, or the snapshots won't match local unset GITHUB_ACTIONS e2e/run/task-runner/src/run-tests.sh shell: bash