-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ on: | |
- next | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
NX_CLOUD_DISTRIBUTED_EXECUTION: true | ||
NX_CLOUD_ACCESS_TOKEN: ${{secrets.NX_CLOUD_ACCESS_TOKEN}} | ||
|
@@ -17,49 +21,24 @@ env: | |
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# consider creating reusable action for this | ||
- uses: actions/checkout@v3 | ||
name: Checkout [Trunk] | ||
if: ${{ github.event_name != 'pull_request' }} | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v3 | ||
name: Checkout [PR] | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
fetch-depth: 0 | ||
- name: Derive appropriate SHAs for base and head for `nx affected` commands | ||
uses: nrwl/nx-set-shas@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: npm | ||
- run: npm ci --ignore-scripts | ||
- run: npx nx workspace-lint | ||
- run: npx nx-cloud start-ci-run | ||
- run: npx nx affected --target=lint --parallel --max-parallel=3 | ||
- run: npx nx affected --target=test --parallel --max-parallel=2 | ||
- run: npx nx affected --target=build --parallel --max-parallel=3 | ||
- run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=docker-build | ||
- run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=release | ||
- run: npx nx-cloud stop-all-agents | ||
|
||
name: Nx Cloud - Main Job | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
secrets: inherit | ||
with: | ||
number-of-agents: 3 | ||
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 --target=lint --parallel=3 | ||
npx nx affected --target=test --parallel=3 --ci --code-coverage | ||
npx nx affected --target=build --parallel=3 | ||
final-commands: | | ||
npx nx affected --target=docker-build | ||
npx nx affected --target=release | ||
agents: | ||
runs-on: ubuntu-latest | ||
name: Agent 1 | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
agent: [1, 2, 3] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: npm | ||
- run: npm ci --ignore-scripts | ||
- name: Start Nx Agent ${{ matrix.agent }} | ||
run: npx nx-cloud start-agent | ||
name: Nx Cloud - Agents | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
secrets: inherit | ||
with: | ||
number-of-agents: 3 |