Skip to content

Commit 57786ab

Browse files
chore: Update Nx cloud workflow (#5515)
1 parent 2eb4570 commit 57786ab

File tree

1 file changed

+26
-83
lines changed

1 file changed

+26
-83
lines changed

.github/workflows/pr.yml

Lines changed: 26 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,37 @@
11
name: pr
2+
23
on: [pull_request]
4+
35
env:
4-
NX_DAEMON: false
56
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
7+
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
8+
69
jobs:
7-
agent:
8-
name: 'Nx Cloud Agents'
10+
main:
11+
name: Nx Cloud
12+
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.0
13+
with:
14+
node-version: 18.16.0
15+
pnpm-version: 8.6.0
16+
main-branch-name: alpha
17+
artifacts-name: nx-cloud-artifact
18+
artifacts-path: |
19+
**/build/**
20+
**/coverage/**
21+
!**/node_modules/**
22+
parallel-commands: |
23+
npx nx test:format
24+
npx nx affected --targets=test:eslint,test:types,test:build,test:lib
25+
codecov:
26+
name: Codecov
27+
needs: main
928
runs-on: ubuntu-latest
10-
timeout-minutes: 20
11-
strategy:
12-
matrix:
13-
agent: [1, 2, 3, 4]
1429
steps:
1530
- uses: actions/checkout@v3
31+
- name: Downloading artifacts
32+
uses: actions/download-artifact@v3
1633
with:
17-
fetch-depth: 0
18-
ref: ${{ github.head_ref }}
19-
repository: ${{github.event.pull_request.head.repo.full_name}}
20-
- name: Setup pnpm
21-
uses: pnpm/action-setup@v2.2.4
22-
with:
23-
version: 8
24-
- name: Setup Node
25-
uses: actions/setup-node@v3
26-
with:
27-
node-version: 18.16.0
28-
cache: 'pnpm'
29-
- name: Install dependencies
30-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
31-
- name: Start Nx Agent ${{ matrix.agent }}
32-
run: npx nx-cloud start-agent
33-
orchestrator:
34-
name: 'Nx Cloud Orchestrator'
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v3
38-
with:
39-
fetch-depth: 0
40-
ref: ${{ github.head_ref }}
41-
repository: ${{github.event.pull_request.head.repo.full_name}}
42-
- name: Setup pnpm
43-
uses: pnpm/action-setup@v2.2.4
44-
with:
45-
version: 8
46-
- name: Setup Node
47-
uses: actions/setup-node@v3
48-
with:
49-
node-version: 18.16.0
50-
cache: 'pnpm'
51-
- name: Install dependencies
52-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
53-
- name: Get appropriate base and head commits for `nx affected` commands
54-
uses: nrwl/nx-set-shas@v3
55-
with:
56-
main-branch-name: 'alpha'
57-
- run: |
58-
echo "BASE: ${{ env.NX_BASE }}"
59-
echo "HEAD: ${{ env.NX_HEAD }}"
60-
- name: Start CI Orchestrator
61-
run: npx nx-cloud start-ci-run
62-
- name: Run All Checks
63-
uses: nick-fields/retry@v2.8.3
64-
env:
65-
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
66-
with:
67-
timeout_minutes: 5
68-
max_attempts: 3
69-
command: npx nx affected --targets=test:eslint,test:types,test:build,test:lib --base=${{ github.event.pull_request.base.sha }}
70-
- name: Stop Agents
71-
run: npx nx-cloud stop-all-agents
34+
name: nx-cloud-artifact
35+
path: .
7236
- name: Upload coverage to Codecov
7337
uses: codecov/codecov-action@v3
74-
format:
75-
name: 'Format'
76-
runs-on: ubuntu-latest
77-
steps:
78-
- uses: actions/checkout@v3
79-
with:
80-
fetch-depth: 0
81-
ref: ${{ github.head_ref }}
82-
repository: ${{github.event.pull_request.head.repo.full_name}}
83-
- name: Setup pnpm
84-
uses: pnpm/action-setup@v2.2.4
85-
with:
86-
version: 8
87-
- name: Setup Node
88-
uses: actions/setup-node@v3
89-
with:
90-
node-version: 18.16.0
91-
cache: 'pnpm'
92-
- name: Install dependencies
93-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
94-
- run: pnpm run test:format --base=${{ github.event.pull_request.base.sha }}

0 commit comments

Comments
 (0)