Skip to content

Commit 1969bab

Browse files
committed
fix: circleci config edits
1 parent f0b45c4 commit 1969bab

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

.circleci/config.yml

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
parameters:
3636
next-version:
3737
type: string
38-
shard:
39-
type: integer
4038
executor: ubuntu
39+
parallelism: 2
4140
steps:
4241
- checkout
4342
- node/install:
@@ -62,10 +61,10 @@ jobs:
6261
name: Get Playwright Version
6362
command: |
6463
PLAYWRIGHT_VERSION=$(npm view @playwright/test version)
65-
echo "export PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $BASH_ENV
64+
echo $PLAYWRIGHT_VERSION > /tmp/playwright-version
6665
- restore_cache:
6766
name: Restore Playwright Cache
68-
key: v1-{{ arch }}-playwright-{{ .Environment.PLAYWRIGHT_VERSION }}
67+
key: v1-{{ arch }}-playwright-{{ checksum "/tmp/playwright-version" }}
6968
- run:
7069
name: Install Playwright Browsers
7170
command: |
@@ -76,22 +75,24 @@ jobs:
7675
name: Save Playwright Cache
7776
paths:
7877
- ~/.cache/ms-playwright
79-
key: v1-{{ arch }}-playwright-{{ .Environment.PLAYWRIGHT_VERSION }}
78+
key: v1-{{ arch }}-playwright-{{ checksum "/tmp/playwright-version" }}
8079
- run:
8180
name: Resolve Next.js version
8281
command: |
83-
RESOLVED_VERSION=$(npm view next@${NEXT_VERSION} version)
82+
RESOLVED_VERSION=$(npm view next@<< parameters.next-version >> version)
8483
echo "export RESOLVED_VERSION=$RESOLVED_VERSION" >> $BASH_ENV
85-
echo "Resolved Next.js version for 'next@${NEXT_VERSION}' is '$RESOLVED_VERSION'"
84+
echo "Resolved Next.js version for 'next@<< parameters.next-version >>' is '$RESOLVED_VERSION'"
8685
- run:
8786
name: Run Playwright tests
88-
command: npm run test:ci:e2e -- --shard=<< parameters.shard >>/5
87+
command: |
88+
SHARD=$((${CIRCLE_NODE_INDEX}+1))
89+
npm run test:ci:e2e -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
8990
environment:
9091
NETLIFY_AUTH_TOKEN: $NETLIFY_AUTH_TOKEN
9192
NEXT_VERSION: << parameters.next-version >>
9293
NEXT_RESOLVED_VERSION: $RESOLVED_VERSION
9394
PLAYWRIGHT_BLOB_OUTPUT_NAME:
94-
report-<< parameters.next-version >>-<< parameters.shard >>.zip
95+
report-<< parameters.next-version >>-{{ .Environment.CIRCLE_NODE_INDEX }}.zip
9596
- persist_to_workspace:
9697
name: Upload Blob Report to CircleCI Artifacts
9798
root: .
@@ -105,9 +106,8 @@ jobs:
105106
os:
106107
type: executor
107108
default: ubuntu
108-
shard:
109-
type: integer
110109
executor: << parameters.os >>
110+
parallelism: 4
111111
steps:
112112
- checkout
113113
- node/install:
@@ -125,18 +125,17 @@ jobs:
125125
- run:
126126
name: Resolve Next.js version
127127
command: |
128-
RESOLVED_VERSION=$(npm view next@${NEXT_VERSION} version)
128+
RESOLVED_VERSION=$(npm view next@<< parameters.next-version >> version)
129129
echo "export RESOLVED_VERSION=$RESOLVED_VERSION" >> $BASH_ENV
130-
echo "Resolved Next.js version for 'next@${NEXT_VERSION}' is '$RESOLVED_VERSION'"
130+
echo "Resolved Next.js version for 'next@<< parameters.next-version >>' is '$RESOLVED_VERSION'"
131131
- run:
132132
name: Compute Fixtures Cache Key
133133
command: |
134134
CACHE_KEY=$(git ls-files -s tests/fixtures/ tests/utils/ tests/prepare.mjs | git hash-object --stdin)
135-
echo "export CACHE_KEY=$CACHE_KEY" >> $BASH_ENV
135+
echo "{$RESOLVED_VERSION}-{$CACHE_KEY}" > /tmp/fixtures-cache-key
136136
- restore_cache:
137137
name: Restore Fixtures Cache
138-
key:
139-
v1-{{ arch }}-fixtures-{{ .Environment.RESOLVED_VERSION }}-{{ .Environment.CACHE_KEY }}
138+
key: v1-{{ arch }}-fixtures-{{ checksum "/tmp/fixtures-cache-key" }}
140139
- run:
141140
name: Prepare Fixtures
142141
command: |
@@ -150,11 +149,12 @@ jobs:
150149
name: Save Fixtures Cache
151150
paths:
152151
- tests/fixtures
153-
key:
154-
v1-{{ arch }}-fixtures-{{ .Environment.RESOLVED_VERSION }}-{{ .Environment.CACHE_KEY }}
152+
key: v1-{{ arch }}-fixtures-{{ checksum "/tmp/fixtures-cache-key" }}
155153
- run:
156154
name: Run Unit and Integration Tests
157-
command: npm run test:ci:unit-and-integration -- --shard=<< parameters.shard >>/8
155+
command: |
156+
SHARD=$((${CIRCLE_NODE_INDEX}+1))
157+
npm run test:ci:unit-and-integration -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
158158
environment:
159159
NETLIFY_AUTH_TOKEN: $NETLIFY_AUTH_TOKEN
160160
NEXT_VERSION: << parameters.next-version >>
@@ -191,9 +191,9 @@ jobs:
191191
- run:
192192
name: Resolve Next.js version
193193
command: |
194-
RESOLVED_VERSION=$(npm view next@${NEXT_VERSION} version)
194+
RESOLVED_VERSION=$(npm view next@<< parameters.next-version >> version)
195195
echo "export RESOLVED_VERSION=$RESOLVED_VERSION" >> $BASH_ENV
196-
echo "Resolved Next.js version for 'next@${NEXT_VERSION}' is '$RESOLVED_VERSION'"
196+
echo "Resolved Next.js version for 'next@<< parameters.next-version >>' is '$RESOLVED_VERSION'"
197197
- run:
198198
name: Run Smoke Tests
199199
command: npm run test:ci:smoke
@@ -222,29 +222,23 @@ jobs:
222222
destination: html-report-<< parameters.next-version >>-${ .Environment.CIRCLE_BUILD_NUM}
223223

224224
workflows:
225-
'Run adapter tests':
225+
build-and-test-adapter:
226226
jobs:
227227
- e2e:
228-
context: [shared-secrets]
229228
matrix:
230229
parameters:
231230
next-version: [<< pipeline.parameters.next-versions >>]
232-
shard: [1, 2, 3, 4, 5]
233231
- test:
234-
context: [shared-secrets]
235232
matrix:
236233
parameters:
237234
next-version: [<< pipeline.parameters.next-versions >>]
238235
os: [ubuntu, windows]
239-
shard: [1, 2, 3, 4, 5, 6, 7, 8]
240236
- smoke:
241-
context: [shared-secrets]
242237
matrix:
243238
parameters:
244239
next-version: [<< pipeline.parameters.next-versions >>]
245240
- merge-reports:
246241
requires: [e2e]
247-
context: [shared-secrets]
248242
matrix:
249243
parameters:
250244
next-version: [<< pipeline.parameters.next-versions >>]

0 commit comments

Comments
 (0)