Skip to content

Commit

Permalink
chore: cleanup ci workflows and use default env
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Sep 8, 2024
1 parent a5b3609 commit 1ff12bc
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 93 deletions.
16 changes: 0 additions & 16 deletions .github/scripts/build.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .github/scripts/deploy.sh

This file was deleted.

15 changes: 5 additions & 10 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coordinator-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
- name: Build
run: |
pnpm run build
working-directory: packages/coordinator

- name: Run hardhat
run: |
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/coordinator-deploy.yml

This file was deleted.

14 changes: 5 additions & 9 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions packages/interface/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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=

Expand Down
17 changes: 13 additions & 4 deletions packages/interface/e2e/connectWallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@ import { test, expect } from "../playwright/fixtures";

test.setTimeout(100000);

test.describe.configure({ retries: 2 });

test.describe("connect wallet", () => {
test.beforeEach(async ({ page }) => {

Check failure on line 8 in packages/interface/e2e/connectWallet.test.ts

View workflow job for this annotation

GitHub Actions / test (20)

[chromium] › connectWallet.test.ts:13:7 › connect wallet › should connect wallet using default metamask account

1) [chromium] › connectWallet.test.ts:13:7 › connect wallet › should connect wallet using default metamask account Test timeout of 100000ms exceeded while running "beforeEach" hook. 6 | 7 | test.describe("connect wallet", () => { > 8 | test.beforeEach(async ({ page }) => { | ^ 9 | await page.goto("/", { timeout: 50000 }); 10 | await page.waitForSelector('button:has-text("Connect wallet")', { state: "visible", timeout: 30000 }); 11 | }); at /home/runner/work/maci-platform/maci-platform/packages/interface/e2e/connectWallet.test.ts:8:8

Check failure on line 8 in packages/interface/e2e/connectWallet.test.ts

View workflow job for this annotation

GitHub Actions / test (20)

[chromium] › connectWallet.test.ts:13:7 › connect wallet › should connect wallet using default metamask account

1) [chromium] › connectWallet.test.ts:13:7 › connect wallet › should connect wallet using default metamask account Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 100000ms exceeded while running "beforeEach" hook. 6 | 7 | test.describe("connect wallet", () => { > 8 | test.beforeEach(async ({ page }) => { | ^ 9 | await page.goto("/", { timeout: 50000 }); 10 | await page.waitForSelector('button:has-text("Connect wallet")', { state: "visible", timeout: 30000 }); 11 | }); at /home/runner/work/maci-platform/maci-platform/packages/interface/e2e/connectWallet.test.ts:8:8
await page.goto("/");
await page.goto("/", { timeout: 50000 });
await page.waitForSelector('button:has-text("Connect wallet")', { state: "visible", timeout: 30000 });

Check warning on line 10 in packages/interface/e2e/connectWallet.test.ts

View workflow job for this annotation

GitHub Actions / check (lint:ts)

Unexpected use of page.waitForSelector()
});

test("should connect wallet using default metamask account", async ({ page }) => {
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 });
});
});

0 comments on commit 1ff12bc

Please sign in to comment.