From 4b73b84c3474ea69ab735712abba84984acc88be Mon Sep 17 00:00:00 2001 From: Slava Date: Fri, 22 Nov 2024 15:50:13 +0300 Subject: [PATCH] chore: update ci --- .github/workflows/playwright.yml | 42 ++++++++++++++++++++++++-------- apps/e2e/.env.example | 9 ++----- package.json | 3 ++- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4da5636f3..b8a26c2dd 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -18,22 +18,44 @@ jobs: - name: Install dependencies uses: ./.github/common-actions/install - - name: Install Playwright Browsers - working-directory: ./apps/e2e - run: pnpm exec playwright install --with-deps + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # pin@v1.2.0 - - name: Build Playwright Cache - working-directory: ./apps/e2e - run: pnpm build:cache:headless + - name: Install Playwright dependencies + run: pnpm dlx playwright@1.48.2 install-deps - - name: Run Playwright tests - run: pnpm test:e2e:ci + # For now, we only need Chromium. + - name: Install browsers for Playwright + run: pnpm dlx playwright@1.48.2 install chromium + + - name: Install linux dependencies + run: | + sudo apt-get install --no-install-recommends -y \ + xvfb + + - name: Serve MetaMask Test Dapp + run: | + pnpm run serve:test-dapp & + + - name: Build cache + env: + PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} + # SEED_PHRASE: ${{ secrets.SEED_PHRASE }} + # WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD }} + SEED_PHRASE: 'test test test test test test test test test test test junk' + WALLET_PASSWORD: 'SynpressIsAwesomeNow!!!' + run: | + xvfb-run pnpm build:e2e:cache + + - name: Run E2E tests (headful) env: PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} - # SECRET_WORDS: ${{ secrets.SECRET_WORDS }} + # SEED_PHRASE: ${{ secrets.SEED_PHRASE }} # WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD }} - SECRET_WORDS: 'test test test test test test test test test test test junk' + SEED_PHRASE: 'test test test test test test test test test test test junk' WALLET_PASSWORD: 'SynpressIsAwesomeNow!!!' + run: | + xvfb-run pnpm test:e2e:ci - name: Archive e2e artifacts uses: actions/upload-artifact@v4 diff --git a/apps/e2e/.env.example b/apps/e2e/.env.example index bc7024fda..e46b740f9 100644 --- a/apps/e2e/.env.example +++ b/apps/e2e/.env.example @@ -1,7 +1,2 @@ -SECRET_WORDS='test test test test test test test test test test test junk' -NETWORK_NAME=bob -RPC_URL="https://l2-fluffy-bob-7mjgi9pmtg.t.conduit.xyz" -CHAIN_ID=901 -SYMBOL=ETH -IS_TESTNET=true -BLOCK_EXPLORER="https://explorerl2-fluffy-bob-7mjgi9pmtg.t.conduit.xyz" +SEED_PHRASE='test test test test test test test test test test test junk' +WALLET_PASSWORD='SynpressIsAwesomeNow!!!' diff --git a/package.json b/package.json index b23471955..d6e7faf0e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "start:evm": "pnpm run --filter bob-evm dev --port 5050", "start:bob-pay": "pnpm run --filter bob-pay dev --port 5050", "test:e2e": "pnpm start:evm && pnpm run --filter bob-e2e test:playwright:headful", - "test:e2e:ci": "pnpm run --filter bob-e2e test:playwright:headless", + "test:e2e:ci": "pnpm run --filter bob-e2e test:playwright:headful", + "build:e2e:cache": "pnpm run --filter bob-e2e build:cache", "postinstall": "husky install", "clean": "pnpm turbo:clean && pnpm clean:node-modules && pnpm clean:lock && pnpm install", "clean:node-modules": "rimraf ./packages/**/**/node_modules && rimraf ./apps/**/node_modules && rm -rf ./node_modules",