From 3dabaa94638ffcb18422e73ebbfc872bc86a2418 Mon Sep 17 00:00:00 2001 From: Mumtahin Farabi Date: Tue, 6 Aug 2024 03:21:15 -0400 Subject: [PATCH] ci(test/e2e): create pipeline --- .github/workflows/{e2e.yml => TEST_e2e.yml} | 32 +++++++++------------ playwright.config.ts | 2 +- 2 files changed, 14 insertions(+), 20 deletions(-) rename .github/workflows/{e2e.yml => TEST_e2e.yml} (58%) diff --git a/.github/workflows/e2e.yml b/.github/workflows/TEST_e2e.yml similarity index 58% rename from .github/workflows/e2e.yml rename to .github/workflows/TEST_e2e.yml index a260a465..f830a86f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/TEST_e2e.yml @@ -1,14 +1,14 @@ -name: Playwright Tests +name: End-to-End Tests on: push: - branches: [main, master] + branches: '*' pull_request: - branches: [main, master] + branches: '*' jobs: test: - timeout-minutes: 60 + timeout-minutes: 5 runs-on: ubuntu-latest strategy: matrix: @@ -20,32 +20,26 @@ jobs: with: fetch-depth: 0 # All history for branches and tags - - name: 📦 Install pnpm - uses: pnpm/action-setup@v4 + - name: 🍞 Install Bun + uses: oven-sh/setup-bun@v2 with: - version: 9 - - - name: 🛠️ Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: '${{ matrix.node-version }}' - cache: pnpm + bun-version: latest - name: 📂 Install Dependencies - run: pnpm i + run: bun install - - name: Install Playwright Browsers - run: pnpm playwright install --with-deps + - name: 🎭 Install Playwright Browsers + run: bun playwright install --with-deps - - name: Run E2E tests + - name: 💀 Run E2E tests env: DATABASE_URL: ${{ secrets.DATABASE_URL }} NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} - run: pnpm playwright test + run: bun playwright test - - name: Upload Artifact + - name: 📄 Upload Artifact uses: actions/upload-artifact@v4 if: always() with: diff --git a/playwright.config.ts b/playwright.config.ts index 0e4cad89..96bf5c29 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -72,7 +72,7 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: { - command: 'pnpm dev', + command: 'bun dev', url: 'http://localhost:8000', reuseExistingServer: !process.env.CI, },