Skip to content

Instantly share code, notes, and snippets.

@pjlamb12
Created October 26, 2022 15:43
Show Gist options
  • Save pjlamb12/9d52c12b7004559cf5066ce7511cbef1 to your computer and use it in GitHub Desktop.
Save pjlamb12/9d52c12b7004559cf5066ce7511cbef1 to your computer and use it in GitHub Desktop.
Nx CI GitHub Actions Workflow
name: Nx Affected CI Linting/Tests/Build
on:
pull_request:
branches: [master]
env:
NX_BRANCH: ${{ github.event.number }}
NX_RUN_GROUP: ${{ github.run_id }}
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.7
with:
main-branch-name: master
number-of-agents: 3
init-commands: |
npx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=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
npx nx affected --target=e2e --parallel=3 --record --key=${{ secrets.CYPRESS_RECORD_KEY }} --headed --browser chrome
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.7
with:
number-of-agents: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment