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