chore(deps): update dependency @clerk/testing to v1.4.26 #2049
Workflow file for this run
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: Build and Test | |
| on: | |
| pull_request: | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 'Install Node' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| run_install: | | |
| - recursive: true | |
| args: [--frozen-lockfile] | |
| - args: [--global, gulp, prettier, vitest] | |
| - name: 'Generate prisma client' | |
| run: pnpm prisma:generate | |
| - name: 'Run Unit Tests' | |
| run: pnpm test:ci | |
| - name: 'Report Coverage' | |
| if: always() | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| - name: 'Lint Code' | |
| run: pnpm lint | |
| test-e2e: | |
| runs-on: ubuntu-latest | |
| needs: unit-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 'Install Docker' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install docker-ce docker-ce-cli containerd.io | |
| - name: 'Set up Node.js' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: 'Install Dependencies' | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: 'Install Playwright Browsers' | |
| run: pnpm exec playwright install | |
| - name: 'Create Docker network' | |
| run: docker network create test-network | |
| - name: 'Set up test database' | |
| run: | | |
| docker run --name test-db -e POSTGRES_PASSWORD=${{ secrets.TEST_DB_PASSWORD }} -e POSTGRES_DB=forvoyez -p 5432:5432 --network test-network -d postgres | |
| docker run --link test-db:postgres --network test-network --rm postgres sh -c 'until pg_isready -h postgres -U postgres; do sleep 1; done;' | |
| - name: 'Run prisma db migrate' | |
| run: | | |
| docker run --rm --network test-network -v $(pwd):/app -w /app -e DATABASE_URL=postgresql://postgres:${{ secrets.TEST_DB_PASSWORD }}@test-db:5432/forvoyez node:22 sh -c "npm install -g pnpm && pnpm run prisma:migrate && pnpm run prisma:seed" | |
| - name: Setup Docker Cache | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver: docker | |
| config-inline: | | |
| [cache.from] | |
| type=gha | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Just Build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| load: true # Charge l'image dans le Docker daemon local | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| tags: forvoyez:test | |
| build-args: NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} | |
| - name: 'Start Docker Container' | |
| run: | | |
| docker run -d --name forvoyez-container -p 3000:3000 \ | |
| -e NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }} \ | |
| -e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} \ | |
| -e CLERK_SECRET_KEY=${{ secrets.CLERK_SECRET_KEY }} \ | |
| -e NEXT_PUBLIC_CLERK_SIGN_IN_URL=${{ secrets.NEXT_PUBLIC_CLERK_SIGN_IN_URL }} \ | |
| -e NEXT_PUBLIC_CLERK_SIGN_UP_URL=${{ secrets.NEXT_PUBLIC_CLERK_SIGN_UP_URL }} \ | |
| -e NEXT_PUBLIC_CLERK_SIGN_OUT_URL=${{ secrets.NEXT_PUBLIC_CLERK_SIGN_OUT_URL }} \ | |
| -e MAILGUN_API_KEY=${{ secrets.MAILGUN_API_KEY }} \ | |
| -e MAILGUN_API_URL=${{ secrets.MAILGUN_API_URL }} \ | |
| -e MAILGUN_PUBLIC_KEY=${{ secrets.MAILGUN_PUBLIC_KEY }} \ | |
| -e MAILGUN_DOMAIN=${{ secrets.MAILGUN_DOMAIN }} \ | |
| -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ | |
| -e JWT_SECRET=${{ secrets.JWT_SECRET }} \ | |
| -e LEMON_SQUEEZY_API_KEY=${{ secrets.LEMON_SQUEEZY_API_KEY }} \ | |
| -e LEMON_SQUEEZY_STORE_ID=${{ secrets.LEMON_SQUEEZY_STORE_ID }} \ | |
| -e LEMON_SQUEEZY_WEBHOOK_SECRET=${{ secrets.LEMON_SQUEEZY_WEBHOOK_SECRET }} \ | |
| -e DATABASE_URL=postgresql://postgres:${{ secrets.TEST_DB_PASSWORD }}@test-db:5432/forvoyez \ | |
| --network test-network \ | |
| forvoyez:test | |
| - name: 'Wait for the application to be ready' | |
| run: | | |
| echo "Waiting for the application to be ready..." | |
| end=$((SECONDS+30)) | |
| while [ $SECONDS -lt $end ]; do | |
| if curl -s http://localhost:3000 > /dev/null; then | |
| echo "Application is up!" | |
| exit 0 | |
| fi | |
| echo "Waiting for the application to be up..." | |
| sleep 5 | |
| done | |
| echo "Application did not start in time" | |
| docker logs forvoyez-container | |
| exit 1 | |
| - name: 'Check Database Connection' | |
| run: | | |
| docker run --rm --network test-network -v $(pwd):/app -w /app -e DATABASE_URL=postgresql://postgres:${{ secrets.TEST_DB_PASSWORD }}@test-db:5432/forvoyez node:22 sh -c "npm install -g pnpm && node check-db-connection.js" | |
| - name: 'Run E2E Tests' | |
| run: pnpm test:e2e:general | |
| env: | |
| NEXT_PUBLIC_URL: http://localhost:3000 | |
| TEST_EMAIL: ${{ secrets.TEST_EMAIL }} | |
| TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
| TEST_EMAIL_SUB: ${{ secrets.TEST_EMAIL_SUB }} | |
| TEST_PASSWORD_SUB: ${{ secrets.TEST_PASSWORD_SUB }} | |
| ENABLE_TEST_LOGS: ${{ secrets.ENABLE_TEST_LOGS }} | |
| CLERK_FRONTEND_API: ${{ secrets.CLERK_FRONTEND_API }} | |
| - name: 'Capture Docker Logs' | |
| if: always() | |
| run: | | |
| docker logs forvoyez-container > docker-logs.txt 2>&1 | |
| - name: 'Upload Test Artifacts' | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-artifacts | |
| path: | | |
| test-results | |
| docker-logs.txt | |
| - name: 'Stop and remove Docker Containers' | |
| run: | | |
| docker stop forvoyez-container | |
| docker rm forvoyez-container | |
| docker stop test-db | |
| docker rm test-db |