Open History to see the last commit
1name: pr
2β
3on:
4 pull_request:
5 paths-ignore:
6 - 'docs/**'
7 - 'media/**'
8 - '**/*.md'
9β
10concurrency:
11 group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
12 cancel-in-progress: true
13β
14env:
15 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
16 NX_CLOUD_DISTRIBUTED_EXECUTION: true
17 NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3
18β
19jobs:
20 main:
21 name: Nx Cloud - Main Job
22 runs-on: ubuntu-latest
23 steps:
24 - name: Checkout
25 uses: actions/checkout@v4
26 with:
27 fetch-depth: 0
28 - name: Setup pnpm
29 uses: pnpm/action-setup@v2
30 with:
31 version: 8
32 - name: Setup Node
33 uses: actions/setup-node@v4
34 with:
35 node-version-file: .nvmrc
36 cache: pnpm
37 - name: Install dependencies
38 run: pnpm install --frozen-lockfile --prefer-offline
39 - name: Get base and head commits for `nx affected`
40 uses: nrwl/nx-set-shas@v3
41 with:
42 main-branch-name: 'main'
43 - name: Start CI Orchestrator
44 run: npx nx-cloud start-ci-run
45 - name: Run Tests
46 run: pnpm run test:pr
47 - name: Stop Agents
48 if: ${{ always() }}
49 run: npx nx-cloud stop-all-agents
50 - name: Upload coverage to Codecov
51 uses: codecov/codecov-action@v3
52 with:
53 directory: packages
54 agents:
55 name: Nx Cloud - Agents
56 runs-on: ubuntu-latest
57 timeout-minutes: 10
58 strategy:
59 matrix:
60 agent: [1, 2, 3]
61 steps:
62 - uses: actions/checkout@v4
63 with:
64 fetch-depth: 0
65 - name: Setup pnpm
66 uses: pnpm/action-setup@v2
67 with:
68 version: 8
69 - name: Setup Node
70 uses: actions/setup-node@v4
71 with:
72 node-version-file: .nvmrc
73 cache: pnpm
74 - name: Install dependencies
75 run: pnpm install --frozen-lockfile --prefer-offline
76 - name: Start Nx Agent ${{ matrix.agent }}
77 run: npx nx-cloud start-agent
78 format:
79 name: Format
80 runs-on: ubuntu-latest
81 steps:
82 - uses: actions/checkout@v4
83 with:
84 fetch-depth: 0
85 - name: Setup pnpm
86 uses: pnpm/action-setup@v2
87 with:
88 version: 8
89 - name: Setup Node
90 uses: actions/setup-node@v4
91 with:
92 node-version-file: .nvmrc
93 cache: pnpm
94 - name: Install dependencies
95 run: pnpm install --frozen-lockfile --prefer-offline
96 - name: Run prettier
97 run: pnpm run test:format
98 knip:
99 name: Knip
100 runs-on: ubuntu-latest
101 steps:
102 - uses: actions/checkout@v4
103 with:
104 fetch-depth: 0
105 - name: Setup pnpm
106 uses: pnpm/action-setup@v2
107 with:
108 version: 8
109 - name: Setup Node
110 uses: actions/setup-node@v4
111 with:
112 node-version-file: .nvmrc
113 cache: pnpm
114 - name: Install dependencies
115 run: pnpm install --frozen-lockfile --prefer-offline
116 - name: Run Knip
117 run: pnpm knip