Skip to content

Commit

Permalink
ci: Optimise Nx workflow (#5636)
Browse files Browse the repository at this point in the history
* ci: Optimise Nx workflow

* Update dynamic-changesets
  • Loading branch information
lachlancollins authored Jun 30, 2024
1 parent e585a2e commit 18d581e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
13 changes: 3 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .nx/workflows/dynamic-changesets.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 18d581e

Please sign in to comment.