Skip to content

Commit f319665

Browse files
authored
chore(repo): Update nightly checks and integration test configurations (#6280)
1 parent 7bfc9f0 commit f319665

17 files changed

Lines changed: 186 additions & 83 deletions

File tree

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: "🐛 Bug Report"
1+
name: '🐛 Bug Report'
22
description: Report a bug in Clerk's JavaScript packages.
33
labels:
4-
- "needs-triage"
4+
- 'needs-triage'
55
body:
66
- type: markdown
77
attributes:
@@ -30,7 +30,7 @@ body:
3030
id: reproduction-link
3131
attributes:
3232
label: Reproduction
33-
placeholder: "https://github.com/username/repository-name/"
33+
placeholder: 'https://github.com/username/repository-name/'
3434
description: |
3535
Link to a minimal reproduction (GitHub repository, CodeSandbox, StackBlitz, etc.).
3636
@@ -44,7 +44,7 @@ body:
4444
id: publishable-key
4545
attributes:
4646
label: Publishable key
47-
placeholder: "pk_test_123456789"
47+
placeholder: 'pk_test_123456789'
4848
description: |
4949
Go to your Clerk dashboard and to the **API Keys** section. Copy the **Publishable key** and paste it here.
5050

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ contact_links:
88
about: Learn more about Clerk and how to use it
99
- name: Feature Requests
1010
url: https://feedback.clerk.com
11-
about: Describe a new capability you would like to see in Clerk's JavaScript packages
11+
about: Describe a new capability you would like to see in Clerk's JavaScript packages

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Description
22

3-
<!--
3+
<!--
44
Thanks for contributing to Clerk. Make sure to read the contributing guide at https://github.com/clerk/javascript/blob/main/docs/CONTRIBUTING.md before opening a PR!
55
66
**Please create a feature request before starting work on any significant change.**

.github/actions/init-blacksmith/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ runs:
126126
run: |
127127
VERSION=$(node -p "require('@playwright/test/package.json').version")
128128
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
129-
129+
130130
- name: Cache Playwright Binaries
131131
if: inputs.playwright-enabled == 'true'
132132
uses: useblacksmith/cache@v5

.github/actions/verdaccio/action.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ inputs:
2222
default: 'http://localhost:4873'
2323

2424
runs:
25-
using: "composite"
25+
using: 'composite'
2626
steps:
2727
- name: Update NPM Registry to Verdaccio
2828
shell: bash
@@ -32,7 +32,15 @@ runs:
3232
shell: bash
3333
run: |
3434
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.publish.yaml & echo "VERDACCIO_PID=$!" >> $GITHUB_ENV
35-
sleep 5
35+
# Wait for Verdaccio to start and verify it's responding
36+
for i in {1..10}; do
37+
if curl -f ${{ inputs.registry }}/ > /dev/null 2>&1; then
38+
echo "Verdaccio is up and running"
39+
break
40+
fi
41+
echo "Waiting for Verdaccio to start (attempt $i)..."
42+
sleep 2
43+
done
3644
pnpm config set $(echo ${{ inputs.registry }} | sed -E 's/https?://')/:_authToken secretToken
3745
3846
- name: Publish to Verdaccio
@@ -41,10 +49,25 @@ runs:
4149

4250
- name: Stop Verdaccio
4351
shell: bash
44-
run: kill -9 $VERDACCIO_PID
52+
run: |
53+
if [ -n "$VERDACCIO_PID" ]; then
54+
kill -9 $VERDACCIO_PID || true
55+
sleep 2
56+
fi
4557
4658
- name: Run Verdaccio (using install config)
4759
shell: bash
4860
run: |
49-
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.install.yaml & sleep 5
61+
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.install.yaml & echo "VERDACCIO_PID=$!" >> $GITHUB_ENV
62+
# Wait for Verdaccio to start and verify it's responding
63+
for i in {1..10}; do
64+
if curl -f ${{ inputs.registry }}/ > /dev/null 2>&1; then
65+
echo "Verdaccio is up and running"
66+
break
67+
fi
68+
echo "Waiting for Verdaccio to start (attempt $i)..."
69+
sleep 2
70+
done
5071
pnpm config set $(echo ${{ inputs.registry }} | sed -E 's/https?://')/:_authToken secretToken
72+
# Verify proxy is working by trying to fetch a known package
73+
pnpm view semver > /dev/null 2>&1 || echo "Warning: Could not fetch semver package, proxy might not be working"

.github/actions/version-prepatch/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
required: true
1010

1111
runs:
12-
using: "composite"
12+
using: 'composite'
1313
steps:
1414
- name: Bump prepatch version
1515
id: bump-prepatch-version

.github/workflows/ci.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
name: Static analysis
134134
permissions:
135135
contents: read
136-
actions: write # needed for actions/upload-artifact
136+
actions: write # needed for actions/upload-artifact
137137
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
138138
defaults:
139139
run:
@@ -193,7 +193,7 @@ jobs:
193193
name: Unit Tests
194194
permissions:
195195
contents: read
196-
actions: write # needed for actions/upload-artifact
196+
actions: write # needed for actions/upload-artifact
197197
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
198198
defaults:
199199
run:
@@ -208,9 +208,9 @@ jobs:
208208
matrix:
209209
include:
210210
- node-version: 18
211-
test-filter: "--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo"
211+
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
212212
- node-version: 22
213-
test-filter: "**"
213+
test-filter: '**'
214214

215215
steps:
216216
- name: Checkout Repo
@@ -266,7 +266,7 @@ jobs:
266266
name: Integration Tests
267267
permissions:
268268
contents: read
269-
actions: write # needed for actions/upload-artifact
269+
actions: write # needed for actions/upload-artifact
270270
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
271271
defaults:
272272
run:
@@ -276,12 +276,26 @@ jobs:
276276
strategy:
277277
fail-fast: false
278278
matrix:
279-
test-name: ['generic', 'express', 'quickstart', 'ap-flows', 'elements', 'localhost', 'sessions', 'astro', 'expo-web', 'tanstack-react-start', 'tanstack-react-router', 'vue', 'nuxt', 'react-router', 'billing']
279+
test-name:
280+
[
281+
'generic',
282+
'express',
283+
'quickstart',
284+
'ap-flows',
285+
'elements',
286+
'localhost',
287+
'sessions',
288+
'astro',
289+
'expo-web',
290+
'tanstack-react-start',
291+
'tanstack-react-router',
292+
'vue',
293+
'nuxt',
294+
'react-router',
295+
'billing',
296+
]
280297
test-project: ['chrome']
281298
include:
282-
- test-name: 'nextjs'
283-
test-project: 'chrome'
284-
next-version: '13'
285299
- test-name: 'nextjs'
286300
test-project: 'chrome'
287301
next-version: '14'
@@ -350,16 +364,16 @@ jobs:
350364
INTEGRATION_CERTS: '${{secrets.INTEGRATION_CERTS}}'
351365
INTEGRATION_ROOT_CA: '${{secrets.INTEGRATION_ROOT_CA}}'
352366
with:
353-
script: |
354-
const fs = require('fs');
355-
const path = require('path');
356-
const rootCa = process.env.INTEGRATION_ROOT_CA;
357-
console.log('rootCa', rootCa);
358-
fs.writeFileSync(path.join(process.env.GITHUB_WORKSPACE, 'integration/certs', 'rootCA.pem'), rootCa);
359-
const certs = JSON.parse(process.env.INTEGRATION_CERTS);
360-
for (const [name, cert] of Object.entries(certs)) {
361-
fs.writeFileSync(path.join(process.env.GITHUB_WORKSPACE, 'integration/certs', name), cert);
362-
}
367+
script: |
368+
const fs = require('fs');
369+
const path = require('path');
370+
const rootCa = process.env.INTEGRATION_ROOT_CA;
371+
console.log('rootCa', rootCa);
372+
fs.writeFileSync(path.join(process.env.GITHUB_WORKSPACE, 'integration/certs', 'rootCA.pem'), rootCa);
373+
const certs = JSON.parse(process.env.INTEGRATION_CERTS);
374+
for (const [name, cert] of Object.entries(certs)) {
375+
fs.writeFileSync(path.join(process.env.GITHUB_WORKSPACE, 'integration/certs', name), cert);
376+
}
363377
364378
- name: LS certs
365379
if: ${{ steps.task-status.outputs.affected == '1' }}
@@ -381,7 +395,6 @@ jobs:
381395
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
382396
NODE_EXTRA_CA_CERTS: ${{ github.workspace }}/integration/certs/rootCA.pem
383397

384-
385398
- name: Upload test-results
386399
if: ${{ cancelled() || failure() }}
387400
uses: actions/upload-artifact@v4

.github/workflows/nightly-checks.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,18 @@ jobs:
4545
run: mkdir clerk-js && cd clerk-js && pnpm init && pnpm add @clerk/clerk-js
4646

4747
- name: Run Integration Tests
48-
run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only
48+
id: integration_tests
49+
continue-on-error: true
50+
run: |
51+
# Capture the output and exit code
52+
OUTPUT_FILE="${{runner.temp}}/test-output.log"
53+
# Only run Typedoc tests for one matrix version
54+
if [ "${{ matrix.test-name }}" == "nextjs" ]; then
55+
E2E_DEBUG=1 E2E_APP_ID=quickstart.next.appRouter pnpm test:integration:base --grep @quickstart 2>&1 | tee "$OUTPUT_FILE"
56+
else
57+
E2E_DEBUG=1 pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only 2>&1 | tee "$OUTPUT_FILE"
58+
fi
59+
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
4960
env:
5061
E2E_APP_CLERK_JS_DIR: ${{runner.temp}}
5162
E2E_CLERK_VERSION: 'latest'
@@ -56,11 +67,36 @@ jobs:
5667
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
5768
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
5869

70+
# Upload test artifacts if tests failed
71+
- name: Upload Test Artifacts
72+
if: steps.integration_tests.outputs.exit_code != '0'
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: test-artifacts-${{ matrix.test-name }}
76+
path: |
77+
${{runner.temp}}/test-output.log
78+
integration/test-results/
79+
integration/.next/
80+
${{runner.temp}}/clerk-js/node_modules/
81+
retention-days: 7
82+
5983
- name: Report Status
6084
if: always()
6185
uses: ravsamhq/notify-slack-action@v1
6286
with:
63-
status: ${{ job.status }}
87+
status: ${{ steps.integration_tests.outputs.exit_code == '0' && 'success' || 'failure' }}
6488
notify_when: 'failure'
89+
notification_title: 'Integration Test Failure - ${{ matrix.test-name }}'
90+
message_format: |
91+
*Job:* ${{ github.workflow }} (${{ matrix.test-name }})
92+
*Status:* ${{ steps.integration_tests.outputs.exit_code == '0' && 'Success' || 'Failed' }}
93+
*Commit:* ${{ github.sha }}
94+
*PR:* ${{ github.event.pull_request.html_url }}
95+
*Artifacts:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
6596
env:
6697
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SDK_E2E_ALERTS_WEBHOOK_URL }}
98+
99+
# Fail the workflow if tests failed
100+
- name: Check Test Status
101+
if: steps.integration_tests.outputs.exit_code != '0'
102+
run: exit 1

.github/workflows/pr-title-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
run: |
2828
npm init --scope=clerk --yes
2929
npm i --save-dev @commitlint/config-conventional @commitlint/cli globby --audit=false --fund=false
30-
echo '${{ github.event.pull_request.title }}' | npm exec @commitlint/cli -- --config commitlint.config.ts
30+
echo '${{ github.event.pull_request.title }}' | npm exec @commitlint/cli -- --config commitlint.config.ts

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.cache
22
.changeset
3-
.github
43
.idea
54
.next
65
.temp_integration

0 commit comments

Comments
 (0)