From 18d581e17d4bb14ba28b50219d7c808a8cfb0a53 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Sun, 30 Jun 2024 13:59:20 +1000 Subject: [PATCH] ci: Optimise Nx workflow (#5636) * ci: Optimise Nx workflow * Update dynamic-changesets --- .github/workflows/ci.yml | 15 +++------------ .github/workflows/pr.yml | 13 +++---------- .nx/workflows/dynamic-changesets.yaml | 6 +++--- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01bd10e825..603d3d2591 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,18 +25,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: '0' - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: pnpm + fetch-depth: 0 - name: Start Nx Agents run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" - - name: Install dependencies - run: pnpm install --frozen-lockfile --prefer-offline + - name: Setup Tools + uses: tanstack/config/.github/setup@main - name: Run Tests run: pnpm run test:ci --parallel=3 - name: Stop Nx Agents @@ -49,8 +42,6 @@ jobs: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" pnpm run cipublish env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} TAG: ${{ inputs.tag }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fb26986bbd..eadbdc3792 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -23,19 +23,12 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: pnpm - name: Start Nx Agents run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" - - name: Install dependencies - run: pnpm install --frozen-lockfile --prefer-offline + - name: Setup Tools + uses: tanstack/config/.github/setup@main - name: Get base and head commits for `nx affected` - uses: nrwl/nx-set-shas@v3 + uses: nrwl/nx-set-shas@v4 with: main-branch-name: 'main' - name: Run Checks diff --git a/.nx/workflows/dynamic-changesets.yaml b/.nx/workflows/dynamic-changesets.yaml index 29c58231b2..d3536f3ba7 100644 --- a/.nx/workflows/dynamic-changesets.yaml +++ b/.nx/workflows/dynamic-changesets.yaml @@ -1,4 +1,4 @@ distribute-on: - small-changeset: 8 linux-medium-js - medium-changeset: 10 linux-medium-js - large-changeset: 12 linux-medium-js + small-changeset: 3 linux-medium-js + medium-changeset: 6 linux-medium-js + large-changeset: 10 linux-medium-js