Skip to content

feat: new and guard (#32) #64

feat: new and guard (#32)

feat: new and guard (#32) #64

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: ${{ !contains(github.event.pull_request.user.login, 'dependabot') }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_TOKEN }}
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@v1
- uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install pnpm
run: npm i -g pnpm
- name: Install deps
run: pnpm i --frozen-lockfile=false
- name: Build Projects
run: pnpm nx affected --target=build --parallel --max-parallel=3
- name: Test Projects
run: pnpm nx affected --target=test --parallel --max-parallel=2
- run: pnpm nx-cloud stop-all-agents
- name: Tag main branch if all jobs succeed
uses: nrwl/nx-tag-successful-ci-run@v1
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@v1
- uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install pnpm
run: npm i -g pnpm
- name: Install deps
run: pnpm i --frozen-lockfile=false
- name: Build Projects
run: pnpm nx affected --target=build --parallel --max-parallel=3
- name: Test Projects
run: pnpm nx affected --target=test --parallel --max-parallel=2
- run: pnpm 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: 18.x
- name: Install pnpm
run: npm i -g pnpm
- name: Install deps
run: pnpm i --frozen-lockfile=false
- name: Start Nx Agent ${{ matrix.agent }}
run: pnpm nx-cloud start-agent