Nightly upstream tests #682
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly upstream tests | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 7 * * *' | |
jobs: | |
integration-tests: | |
name: Integration Tests | |
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }} | |
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_EXTENDED && fromJSON(vars.TIMEOUT_MINUTES_EXTENDED) || 30 }} | |
strategy: | |
matrix: | |
test-name: ['nextjs'] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
show-progress: false | |
- name: Setup | |
id: config | |
uses: ./.github/actions/init | |
with: | |
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} | |
turbo-team: ${{ vars.TURBO_TEAM }} | |
turbo-token: ${{ secrets.TURBO_TOKEN }} | |
playwright-enabled: true | |
- name: Verdaccio | |
uses: ./.github/actions/verdaccio | |
with: | |
publish-cmd: | | |
if [ "$(npm 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 | |
- name: Install @clerk/backend in /integration | |
working-directory: ./integration | |
run: pnpm init && pnpm add @clerk/backend | |
- name: Install @clerk/clerk-js in os temp | |
working-directory: ${{runner.temp}} | |
run: mkdir clerk-js && cd clerk-js && pnpm init && pnpm add @clerk/clerk-js | |
- name: Run Integration Tests | |
id: integration_tests | |
continue-on-error: true | |
run: | | |
# Capture the output and exit code | |
OUTPUT_FILE="${{runner.temp}}/test-output.log" | |
# Only run Typedoc tests for one matrix version | |
if [ "${{ matrix.test-name }}" == "nextjs" ]; then | |
E2E_DEBUG=1 E2E_APP_ID=quickstart.next.appRouter pnpm test:integration:base --grep @quickstart 2>&1 | tee "$OUTPUT_FILE" | |
else | |
E2E_DEBUG=1 pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only 2>&1 | tee "$OUTPUT_FILE" | |
fi | |
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT | |
env: | |
E2E_APP_CLERK_JS_DIR: ${{runner.temp}} | |
E2E_CLERK_VERSION: 'latest' | |
E2E_NEXTJS_VERSION: 'canary' | |
E2E_NPM_FORCE: 'true' | |
E2E_REACT_DOM_VERSION: '19.1.0' | |
E2E_REACT_VERSION: '19.1.0' | |
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} | |
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} | |
# Upload test artifacts if tests failed | |
- name: Upload Test Artifacts | |
if: steps.integration_tests.outputs.exit_code != '0' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts-${{ matrix.test-name }} | |
path: | | |
${{runner.temp}}/test-output.log | |
integration/test-results/ | |
integration/.next/ | |
${{runner.temp}}/clerk-js/node_modules/ | |
retention-days: 7 | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v1 | |
with: | |
status: ${{ steps.integration_tests.outputs.exit_code == '0' && 'success' || 'failure' }} | |
notify_when: 'failure' | |
notification_title: 'Integration Test Failure - ${{ matrix.test-name }}' | |
message_format: | | |
*Job:* ${{ github.workflow }} (${{ matrix.test-name }}) | |
*Status:* ${{ steps.integration_tests.outputs.exit_code == '0' && 'Success' || 'Failed' }} | |
*Commit:* ${{ github.sha }} | |
*PR:* ${{ github.event.pull_request.html_url }} | |
*Artifacts:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SDK_E2E_ALERTS_WEBHOOK_URL }} | |
# Fail the workflow if tests failed | |
- name: Check Test Status | |
if: steps.integration_tests.outputs.exit_code != '0' | |
run: exit 1 |