Skip to content

Commit 35f4e83

Browse files
committed
update CI to include RQ variants
1 parent a9df03b commit 35f4e83

File tree

1 file changed

+53
-11
lines changed

1 file changed

+53
-11
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
unit-tests:
192192
needs: [check-permissions, build-packages]
193193
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
194-
name: Unit Tests
194+
name: Unit Tests (${{ matrix.node-version }}, ${{ matrix.filter-label }}${{ matrix.clerk-use-rq == 'true' && ', RQ' || '' }})
195195
permissions:
196196
contents: read
197197
actions: write # needed for actions/upload-artifact
@@ -205,11 +205,17 @@ jobs:
205205
TURBO_SUMMARIZE: false
206206

207207
strategy:
208-
fail-fast: true
208+
fail-fast: false
209209
matrix:
210210
include:
211211
- node-version: 22
212212
test-filter: "**"
213+
clerk-use-rq: "false"
214+
filter-label: "**"
215+
- node-version: 22
216+
test-filter: "--filter=@clerk/shared --filter=@clerk/clerk-js"
217+
clerk-use-rq: "true"
218+
filter-label: "shared, clerk-js"
213219

214220
steps:
215221
- name: Checkout Repo
@@ -229,22 +235,35 @@ jobs:
229235
turbo-team: ${{ vars.TURBO_TEAM }}
230236
turbo-token: ${{ secrets.TURBO_TOKEN }}
231237

238+
- name: Rebuild @clerk/shared with CLERK_USE_RQ=true
239+
if: ${{ matrix.clerk-use-rq == 'true' }}
240+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared --force
241+
env:
242+
CLERK_USE_RQ: true
243+
244+
- name: Rebuild dependent packages with CLERK_USE_RQ=true
245+
if: ${{ matrix.clerk-use-rq == 'true' }}
246+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared^... --force
247+
env:
248+
CLERK_USE_RQ: true
249+
232250
- name: Run tests in packages
233251
run: |
234252
if [ "${{ matrix.test-filter }}" = "**" ]; then
235-
echo "Running full test suite on Node ${{ matrix.node-version }}."
253+
echo "Running full test suite on Node ${{ matrix.node-version }}"
236254
pnpm turbo test $TURBO_ARGS
237255
else
238-
echo "Running LTS subset on Node ${{ matrix.node-version }}."
256+
echo "Running tests: ${{ matrix.filter-label }}"
239257
pnpm turbo test $TURBO_ARGS ${{ matrix.test-filter }}
240258
fi
241259
env:
242260
NODE_VERSION: ${{ matrix.node-version }}
261+
CLERK_USE_RQ: ${{ matrix.clerk-use-rq }}
243262

244263
- name: Run Typedoc tests
245264
run: |
246-
# Only run Typedoc tests for one matrix version
247-
if [ "${{ matrix.node-version }}" == "22" ]; then
265+
# Only run Typedoc tests for one matrix version and main test run
266+
if [ "${{ matrix.node-version }}" == "22" ] && [ "${{ matrix.test-filter }}" = "**" ]; then
248267
pnpm test:typedoc
249268
fi
250269
env:
@@ -255,14 +274,14 @@ jobs:
255274
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
256275
continue-on-error: true
257276
with:
258-
name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-node-${{ matrix.node-version }}
277+
name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-node-${{ matrix.node-version }}${{ matrix.clerk-use-rq == 'true' && '-rq' || '' }}
259278
path: .turbo/runs
260279
retention-days: 5
261280

262281
integration-tests:
263282
needs: [check-permissions, build-packages]
264283
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
265-
name: Integration Tests
284+
name: Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }}${{ matrix.next-version && format(', {0}', matrix.next-version) || '' }}${{ matrix.clerk-use-rq == 'true' && ', RQ' || '' }})
266285
permissions:
267286
contents: read
268287
actions: write # needed for actions/upload-artifact
@@ -291,18 +310,28 @@ jobs:
291310
'vue',
292311
'nuxt',
293312
'react-router',
294-
'billing',
295313
'machine',
296314
'custom',
297315
]
298316
test-project: ["chrome"]
299317
include:
318+
- test-name: 'billing'
319+
test-project: 'chrome'
320+
clerk-use-rq: 'false'
321+
- test-name: 'billing'
322+
test-project: 'chrome'
323+
clerk-use-rq: 'true'
300324
- test-name: 'nextjs'
301325
test-project: 'chrome'
302326
next-version: '14'
303327
- test-name: 'nextjs'
304328
test-project: 'chrome'
305329
next-version: '15'
330+
clerk-use-rq: 'false'
331+
- test-name: 'nextjs'
332+
test-project: 'chrome'
333+
next-version: '15'
334+
clerk-use-rq: 'true'
306335
- test-name: 'nextjs'
307336
test-project: 'chrome'
308337
next-version: '16'
@@ -360,12 +389,24 @@ jobs:
360389
echo "affected=${AFFECTED}"
361390
echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT
362391
392+
- name: Rebuild @clerk/shared with CLERK_USE_RQ=true
393+
if: ${{ steps.task-status.outputs.affected == '1' && matrix.clerk-use-rq == 'true' }}
394+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared --force
395+
env:
396+
CLERK_USE_RQ: true
397+
398+
- name: Rebuild dependent packages with CLERK_USE_RQ=true
399+
if: ${{ steps.task-status.outputs.affected == '1' && matrix.clerk-use-rq == 'true' }}
400+
run: pnpm turbo build $TURBO_ARGS --filter=@clerk/shared^... --force
401+
env:
402+
CLERK_USE_RQ: true
403+
363404
- name: Verdaccio
364405
if: ${{ steps.task-status.outputs.affected == '1' }}
365406
uses: ./.github/actions/verdaccio
366407
with:
367408
publish-cmd: |
368-
if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag; fi
409+
if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else CLERK_USE_RQ=${{ matrix.clerk-use-rq }} pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag; fi
369410
370411
- name: Edit .npmrc [link-workspace-packages=false]
371412
run: sed -i -E 's/link-workspace-packages=(deep|true)/link-workspace-packages=false/' .npmrc
@@ -425,6 +466,7 @@ jobs:
425466
E2E_NEXTJS_VERSION: ${{ matrix.next-version }}
426467
E2E_PROJECT: ${{ matrix.test-project }}
427468
E2E_CLERK_ENCRYPTION_KEY: ${{ matrix.clerk-encryption-key }}
469+
CLERK_USE_RQ: ${{ matrix.clerk-use-rq }}
428470
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
429471
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
430472
NODE_EXTRA_CA_CERTS: ${{ github.workspace }}/integration/certs/rootCA.pem
@@ -433,7 +475,7 @@ jobs:
433475
if: ${{ cancelled() || failure() }}
434476
uses: actions/upload-artifact@v4
435477
with:
436-
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}
478+
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}${{ matrix.clerk-use-rq == 'true' && '-rq' || '' }}
437479
path: integration/test-results
438480
retention-days: 1
439481

0 commit comments

Comments
 (0)