diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96c615a8..306bdf63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,3 +51,60 @@ jobs: NEXT_PUBLIC_SMART_ACCOUNT_WASM_HASH: ${{ secrets.NEXT_PUBLIC_SMART_ACCOUNT_WASM_HASH || 'a12e8fa9621efd20315753bd4007d974390e31fbcb4a7ddc4dd0a0dec728bf2e' }} NEXT_PUBLIC_WEBAUTHN_VERIFIER_ADDRESS: ${{ secrets.NEXT_PUBLIC_WEBAUTHN_VERIFIER_ADDRESS || 'CBSHV66WG7UV6FQVUTB67P3DZUEJ2KJ5X6JKQH5MFRAAFNFJUAJVXJYV' }} NEXT_PUBLIC_NATIVE_TOKEN_CONTRACT: ${{ secrets.NEXT_PUBLIC_NATIVE_TOKEN_CONTRACT || 'CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC' }} + + test-e2e: + runs-on: ubuntu-latest + needs: build-and-lint + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js 24.x + uses: actions/setup-node@v4 + with: + node-version: 24.x + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: latest + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ~/.local/share/pnpm/store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build project + run: pnpm build + env: + NODE_ENV: production + NEXT_PUBLIC_STELLAR_RPC_URL: ${{ secrets.NEXT_PUBLIC_STELLAR_RPC_URL || 'https://soroban-testnet.stellar.org' }} + NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE: ${{ secrets.NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE || 'Test SDF Network ; September 2015' }} + NEXT_PUBLIC_SMART_ACCOUNT_WASM_HASH: ${{ secrets.NEXT_PUBLIC_SMART_ACCOUNT_WASM_HASH || 'a12e8fa9621efd20315753bd4007d974390e31fbcb4a7ddc4dd0a0dec728bf2e' }} + NEXT_PUBLIC_WEBAUTHN_VERIFIER_ADDRESS: ${{ secrets.NEXT_PUBLIC_WEBAUTHN_VERIFIER_ADDRESS || 'CBSHV66WG7UV6FQVUTB67P3DZUEJ2KJ5X6JKQH5MFRAAFNFJUAJVXJYV' }} + NEXT_PUBLIC_NATIVE_TOKEN_CONTRACT: ${{ secrets.NEXT_PUBLIC_NATIVE_TOKEN_CONTRACT || 'CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC' }} + + - name: Install Playwright Chromium + run: pnpm exec playwright install chromium --with-deps + + - name: Run E2E tests + run: pnpm run test:e2e + env: + CI: true + NEXT_PUBLIC_GRAPHQL_URL: http://localhost:3000/api/graphql + NEXT_PUBLIC_API_URL: http://localhost:3000 + + - name: Upload Playwright report + if: always() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 diff --git a/.gitignore b/.gitignore index 7b8da95f..52c525ee 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ # testing /coverage +/playwright-report +/test-results +/blob-report # next.js /.next/ diff --git a/components/bounty-detail/bounty-detail-sidebar-cta.tsx b/components/bounty-detail/bounty-detail-sidebar-cta.tsx index 3aa9dd19..e1e33314 100644 --- a/components/bounty-detail/bounty-detail-sidebar-cta.tsx +++ b/components/bounty-detail/bounty-detail-sidebar-cta.tsx @@ -74,7 +74,7 @@ export function SidebarCTA({ bounty, onCancelled }: SidebarCTAProps) { const isFinalized = bounty.status === "COMPLETED"; const submissionCount = bounty._count?.submissions ?? 0; - const { hasJoined, isPastDeadline, joinMutation, handleJoin } = + const { walletAddress, hasJoined, isPastDeadline, joinMutation, handleJoin } = useCompetitionJoinState(bounty); const handleCopy = async () => { @@ -184,8 +184,14 @@ export function SidebarCTA({ bounty, onCancelled }: SidebarCTAProps) { ) : (