Skip to content

Commit 52f93a5

Browse files
ci(v4): fix Nx commands
1 parent 4f93b86 commit 52f93a5

File tree

2 files changed

+14
-43
lines changed

2 files changed

+14
-43
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
cache: pnpm
4242
cache-dependency-path: pnpm-lock.yaml
4343
- name: Install dependencies
44-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
44+
run: pnpm install --frozen-lockfile
4545
- name: Run Tests
46-
run: pnpm run test:ci --base=${{ github.event.before }}
46+
run: pnpm run test:ci
4747
- name: Publish
4848
run: |
4949
git config --global user.name 'Tanner Linsley'

.github/workflows/pr.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
jobs:
1717
main:
18-
name: Nx Cloud - Main Job
18+
name: Nx Cloud
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
@@ -31,46 +31,15 @@ jobs:
3131
cache: pnpm
3232
cache-dependency-path: pnpm-lock.yaml
3333
- name: Install dependencies
34-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
35-
- name: Get appropriate base and head commits for `nx affected` commands
36-
uses: nrwl/nx-set-shas@v3
34+
run: pnpm install --frozen-lockfile
35+
- name: Get base and head commits for `nx affected`
36+
uses: nrwl/nx-set-shas@v4.3.0
3737
with:
38-
main-branch-name: 'main'
39-
- run: |
40-
echo "BASE: ${{ env.NX_BASE }}"
41-
echo "HEAD: ${{ env.NX_HEAD }}"
42-
- name: Start CI Orchestrator
43-
run: npx nx-cloud start-ci-run
38+
main-branch-name: main
4439
- name: Run Tests
4540
run: pnpm run test:pr
46-
- name: Stop Agents
47-
run: npx nx-cloud stop-all-agents
4841
- name: Upload coverage to Codecov
4942
uses: codecov/codecov-action@v3
50-
agents:
51-
name: Nx Cloud - Agents
52-
runs-on: ubuntu-latest
53-
timeout-minutes: 10
54-
strategy:
55-
matrix:
56-
agent: [1, 2, 3]
57-
steps:
58-
- name: Checkout
59-
uses: actions/[email protected]
60-
with:
61-
fetch-depth: 0
62-
- name: Setup pnpm
63-
uses: pnpm/[email protected]
64-
- name: Setup Node
65-
uses: actions/setup-node@v3
66-
with:
67-
node-version-file: .nvmrc
68-
cache: pnpm
69-
cache-dependency-path: pnpm-lock.yaml
70-
- name: Install dependencies
71-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
72-
- name: Start Nx Agent ${{ matrix.agent }}
73-
run: npx nx-cloud start-agent
7443
format:
7544
name: Format
7645
runs-on: ubuntu-latest
@@ -88,7 +57,7 @@ jobs:
8857
cache: pnpm
8958
cache-dependency-path: pnpm-lock.yaml
9059
- name: Install dependencies
91-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
60+
run: pnpm install --frozen-lockfile
9261
- name: Run prettier
9362
run: pnpm run test:format
9463
test-react-17:
@@ -109,15 +78,17 @@ jobs:
10978
cache: pnpm
11079
cache-dependency-path: pnpm-lock.yaml
11180
- name: Install dependencies
112-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
113-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
114-
uses: nrwl/nx-set-shas@v2
81+
run: pnpm install --frozen-lockfile
82+
- name: Get base and head commits for `nx affected`
83+
uses: nrwl/[email protected]
84+
with:
85+
main-branch-name: main
11586
- name: Run Tests
11687
uses: nick-fields/[email protected]
11788
with:
11889
timeout_minutes: 5
11990
max_attempts: 3
120-
command: npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }}
91+
command: pnpm nx affected --targets=test:lib
12192
env:
12293
NX_CLOUD_DISTRIBUTED_EXECUTION: false
12394
REACTJS_VERSION: 17

0 commit comments

Comments
 (0)