From c5ba8176a68b4221d4e3d3c35495820290191fad Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Sun, 8 Sep 2024 12:43:14 +0500 Subject: [PATCH] chore: cleanup ci workflows and use default env --- .github/workflows/checks.yml | 15 +++----- .github/workflows/coordinator-build.yml | 1 + .github/workflows/coordinator-deploy.yml | 37 -------------------- .github/workflows/e2e.yml | 14 +++----- packages/interface/.env.example | 8 ++--- packages/interface/e2e/connectWallet.test.ts | 12 +++++-- 6 files changed, 24 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/coordinator-deploy.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index abc940be..bcfe6337 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -5,16 +5,6 @@ on: branches: [main] pull_request: -env: - NEXT_PUBLIC_CHAIN_NAME: ${{ vars.NEXT_PUBLIC_CHAIN_NAME }} - NEXT_PUBLIC_ADMIN_ADDRESS: ${{ vars.NEXT_PUBLIC_ADMIN_ADDRESS }} - NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }} - NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }} - NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }} - NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }} - NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }} - NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }} - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -44,6 +34,11 @@ jobs: run: | pnpm install + - name: Copy .env.example to .env + run: | + cp .env.example .env + working-directory: packages/interface + - name: Build run: | pnpm build diff --git a/.github/workflows/coordinator-build.yml b/.github/workflows/coordinator-build.yml index 5a868b65..94f00021 100644 --- a/.github/workflows/coordinator-build.yml +++ b/.github/workflows/coordinator-build.yml @@ -80,6 +80,7 @@ jobs: - name: Build run: | pnpm run build + working-directory: packages/coordinator - name: Run hardhat run: | diff --git a/.github/workflows/coordinator-deploy.yml b/.github/workflows/coordinator-deploy.yml deleted file mode 100644 index 58665e92..00000000 --- a/.github/workflows/coordinator-deploy.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CoordinatorDeploy -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - deploy: - runs-on: ubuntu-22.04 - permissions: - id-token: write - contents: read - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::490752553772:role/maci-coordinator-ecs-deploy-slc - role-duration-seconds: 2700 - aws-region: eu-central-1 - - - name: Build and Push images to ECR - run: | - .github/scripts/build.sh ${{ secrets.COORDINATOR_RPC_URL }} ${{ secrets.COORDINATOR_ADDRESSES }} ${{ secrets.COORDINATOR_ALLOWED_ORIGINS }} - - - name: Create Deployment - run: | - .github/scripts/deploy.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b25691ca..a0f2e5d5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -10,14 +10,6 @@ on: pull_request: env: - NEXT_PUBLIC_CHAIN_NAME: ${{ vars.NEXT_PUBLIC_CHAIN_NAME }} - NEXT_PUBLIC_ADMIN_ADDRESS: ${{ vars.NEXT_PUBLIC_ADMIN_ADDRESS }} - NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }} - NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }} - NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }} - NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }} - NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }} - NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }} NEXT_PUBLIC_FEEDBACK_URL: ${{ vars.NEXT_PUBLIC_FEEDBACK_URL }} NEXT_PUBLIC_MACI_START_BLOCK: ${{ vars.NEXT_PUBLIC_MACI_START_BLOCK }} NEXT_PUBLIC_MACI_SUBGRAPH_URL: ${{ vars.NEXT_PUBLIC_MACI_SUBGRAPH_URL }} @@ -32,7 +24,6 @@ env: NEXT_PUBLIC_VOTING_END_DATE: ${{ vars.NEXT_PUBLIC_VOTING_END_DATE }} NEXT_PUBLIC_RESULTS_DATE: ${{ vars.NEXT_PUBLIC_RESULTS_DATE }} TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }} - WALLET_PRIVATE_KEY: "" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -86,6 +77,11 @@ jobs: pnpm run install:chromium working-directory: packages/interface + - name: Copy .env.example to .env + run: | + cp .env.example .env + working-directory: packages/interface + - name: Build run: pnpm run build working-directory: packages/interface diff --git a/packages/interface/.env.example b/packages/interface/.env.example index 318f04c1..616bf8b1 100644 --- a/packages/interface/.env.example +++ b/packages/interface/.env.example @@ -17,14 +17,14 @@ NEXT_PUBLIC_ALCHEMY_ID= # WalletConnect (optional to support more wallets) # Get your projectId at https://cloud.walletconnect.com -NEXT_PUBLIC_WALLETCONNECT_ID= +NEXT_PUBLIC_WALLETCONNECT_ID="21fef48091f12692cad574a6f7753643" # ----------------- # APP CONFIGURATION # ----------------- # Event title for the round, just for display -NEXT_PUBLIC_EVENT_NAME="ETH GLOBAL" +NEXT_PUBLIC_EVENT_NAME="Devcon" # Unique identifier for your applications and lists - your app will group attestations by this id NEXT_PUBLIC_ROUND_ID="open-rpgf-1" @@ -45,7 +45,7 @@ NEXT_PUBLIC_FEEDBACK_URL=https://github.com/privacy-scaling-explorations/maci-pl # address that will approve applications and voters # (leaving empty means anyone can do this) -NEXT_PUBLIC_ADMIN_ADDRESS= +NEXT_PUBLIC_ADMIN_ADDRESS="0x0000000000000000000000000000000000000000" # ----------------- # EAS CONFIGURATION @@ -74,7 +74,7 @@ NEXT_PUBLIC_SEMAPHORE_SUBGRAPH= # Do this if the schemas doesn't exist on the network you're using. WALLET_PRIVATE_KEY="" -NEXT_PUBLIC_MACI_ADDRESS= +NEXT_PUBLIC_MACI_ADDRESS="0x0000000000000000000000000000000000000000" NEXT_PUBLIC_MACI_START_BLOCK= diff --git a/packages/interface/e2e/connectWallet.test.ts b/packages/interface/e2e/connectWallet.test.ts index da1a9fc1..5c2f5783 100644 --- a/packages/interface/e2e/connectWallet.test.ts +++ b/packages/interface/e2e/connectWallet.test.ts @@ -11,13 +11,19 @@ test.describe("connect wallet", () => { await page.getByRole("button", { name: "Connect wallet" }).first().click(); await page.getByTestId("rk-wallet-option-io.metamask").click(); - const metamask = await page.context().waitForEvent("page"); + const metamask = await page.context().waitForEvent("page", { timeout: 30000 }); + await metamask.getByText("Next").waitFor({ state: "visible", timeout: 10000 }); await metamask.getByText("Next").click(); + + // Wait for the footer next button to be visible and clickable + await metamask.getByTestId("page-container-footer-next").waitFor({ state: "visible", timeout: 10000 }); await metamask.getByTestId("page-container-footer-next").click(); - await metamask.waitForTimeout(2_000); + // Replace fixed timeout with a wait for a specific element or state change + await metamask.getByTestId("page-container-footer-next").waitFor({ state: "visible", timeout: 10000 }); await metamask.getByTestId("page-container-footer-next").click(); - await expect(page.getByText(/0xf3.+2266/)).toBeInViewport(); + // Wait for the wallet address to appear with a timeout + await expect(page.getByText(/0xf3.+2266/)).toBeInViewport({ timeout: 20000 }); }); });