Skip to content

Commit

Permalink
ci: update workflows to use nx cloud distributed task
Browse files Browse the repository at this point in the history
  • Loading branch information
floross committed Nov 30, 2022
1 parent 6c6d67d commit 4744667
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/stack-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ concurrency:
jobs:
test:
name: Test all packages
uses: ./.github/workflows/test.yml
with:
codecov: true
uses: ./.github/workflows/test-nx-cloud.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
32 changes: 16 additions & 16 deletions .github/workflows/test-nx-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@ name: Tests

on:
workflow_call:
inputs:
registryUrl:
default: 'https://registry.npmjs.org'
description: 'The npm token if needed'
required: false
type: string

secrets:
NPM_TOKEN:
description: 'The npm token if needed'
required: false

CODECOV_TOKEN:
description: 'The codecov token if needed'
required: false
Expand All @@ -28,21 +17,32 @@ on:
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/[email protected]
uses: nrwl/ci/.github/workflows/[email protected]
secrets:
NX_CLOUD_ACCESS_TOKEN: ${secrets.NX_CLOUD_ACCESS_TOKEN}
NX_CLOUD_AUTH_TOKEN: ${secrets.NX_CLOUD_ACCESS_TOKEN}
with:
number-of-agents: 3
init-commands: |
npm run generate
install-commands: |
npm ci --no-audit --no-progress --force --ignore-scripts
npm rebuild
npm run install --if-present
npm run prepare --if-present
parallel-commands: |
npx nx-cloud record -- npx nx workspace-lint
npx nx-cloud record -- npx nx format:check
parallel-commands-on-agents: |
npx nx affected --base=remotes/origin/main --parallel=3 --target=lint & \
npx nx affected --base=remotes/origin/main --parallel=3 --target=test --ci --codeCoverage & \
npx nx affected --base=remotes/origin/main --parallel=3 --target=build
npx nx affected --base=remotes/origin/main --parallel=3 --target=lint & npx nx affected --base=remotes/origin/main --parallel=3 --target=test --ci --codeCoverage & npx nx affected --base=remotes/origin/main --parallel=3 --target=build
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.8
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.10
with:
number-of-agents: 3
install-commands: |
npm ci --no-audit --no-progress --force --ignore-scripts
npm rebuild
npm run install --if-present
npm run prepare --if-present

0 comments on commit 4744667

Please sign in to comment.