Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
feat(ci): add nx workflow #17
Browse files Browse the repository at this point in the history
  • Loading branch information
0x77dev committed Jan 29, 2022
1 parent 68d3d68 commit 5c03395
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/nx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI
on:
push:
branches:
- main
pull_request:

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true

jobs:
main:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v2
name: Checkout [main]
with:
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@v1
with:
node-version: "14"
- run: npm install
- run: npx nx-cloud start-ci-run
- run: npx nx affected --target=build --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=2
- run: npx nx-cloud stop-all-agents
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v2
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@v1
with:
node-version: "14"
- run: npm install
- run: npx nx-cloud start-ci-run
- run: npx nx affected --target=build --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=2
- run: npx nx-cloud stop-all-agents
agents:
runs-on: ubuntu-latest
name: Agent 1
timeout-minutes: 60
strategy:
matrix:
agent: [1, 2, 3]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- run: npm install
- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent

0 comments on commit 5c03395

Please sign in to comment.