update attestion json #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests After Deployment | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| workflow_call: | |
| secrets: | |
| RUNNER_PRIVATE_KEY: | |
| required: true | |
| PRIVATE_KEY_PASSWORD: | |
| required: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| # env: | |
| # REGISTRY: ghcr.io | |
| # IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| e2e-tests: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Wait for the deployment to stabilize with better health check | |
| - name: Wait for deployment to stabilize | |
| run: | | |
| echo "Waiting for deployment to stabilize..." | |
| MAX_ATTEMPTS=15 | |
| ATTEMPT=0 | |
| while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do | |
| HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://dev.inblock.io/health) | |
| if [[ $HTTP_STATUS -eq 200 ]]; then | |
| echo "Site is healthy with status code $HTTP_STATUS!" | |
| exit 0 | |
| fi | |
| ATTEMPT=$((ATTEMPT+1)) | |
| echo "Attempt $ATTEMPT/$MAX_ATTEMPTS: Site not ready yet (status code $HTTP_STATUS), waiting..." | |
| sleep 10 | |
| done | |
| echo "Warning: Site not fully healthy after $MAX_ATTEMPTS attempts, proceeding with tests anyway..." | |
| - name: Create .env file for e2e tests | |
| run: | | |
| cat > e2e/.env << EOL | |
| LETSENCRYPT_EMAIL=test@example.com | |
| VITE_INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID }} | |
| FRONTEND_URL=https://dev.inblock.io | |
| BACKEND_URL=https://dev-api.inblock.io | |
| DB_USER=aquafier | |
| DB_PASSWORD=changeme | |
| BASE_URL=https://dev.inblock.io | |
| PREFUNDED_WALLET_PRIVATEKEY=${{ secrets.PREFUNDED_WALLET_PRIVATEKEY }} | |
| ALCHEMY_PROJECT_ID=${{ secrets.ALCHEMY_PROJECT_ID }} | |
| EOL | |
| echo "Created .env file with necessary environment variables" | |
| - name: Create .env file for aqua-container tests on the root directory | |
| run: | | |
| cat > .env << EOL | |
| LETSENCRYPT_EMAIL=test@example.com | |
| VITE_INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID }} | |
| FRONTEND_URL=https://dev.inblock.io | |
| BACKEND_URL=https://dev-api.inblock.io | |
| DB_USER=aquafier | |
| DB_PASSWORD=changeme | |
| BASE_URL=https://dev.inblock.io | |
| PREFUNDED_WALLET_PRIVATEKEY=${{ secrets.PREFUNDED_WALLET_PRIVATEKEY }} | |
| ALCHEMY_PROJECT_ID=${{ secrets.ALCHEMY_PROJECT_ID }} | |
| EOL | |
| echo "Created .env file with necessary environment variables" | |
| - name: Setup test environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xvfb libgtk-3-0 libnotify-dev libnss3 libxss1 | |
| echo "Installed required system dependencies" | |
| # - name: build and load docker image | |
| # uses: ./.github/actions/build_container | |
| # with: | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| # push: 'false' | |
| # load: 'true' | |
| # tags: 'latest' | |
| # - name: Set up Docker Compose | |
| # run: | | |
| # sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" \ | |
| # -o /usr/local/bin/docker-compose | |
| # sudo chmod +x /usr/local/bin/docker-compose | |
| # - name: Set up docker environment | |
| # run: | | |
| # cat > deployment/.env << DEOL | |
| # # psql conn string for prisma | |
| # DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@localhost:5432/aquafier_js?schema=public" | |
| # #letsencrypt | |
| # LETSENCRYPT_EMAIL=hello@inblock.io | |
| # BASE_URL=https://dev.inblock.io | |
| # DEOL | |
| # echo "Created .env file with necessary environment variables" | |
| # - name: Prepare local test environment | |
| # run: cd e2e && docker compose -f ../deployment/docker-compose-local.yml up -d | |
| # - name: Wait for services to be ready | |
| # run: | | |
| # echo "Waiting for services to be ready..." | |
| # sleep 30 | |
| # docker ps | |
| # docker logs aquafier-postgres --tail 50 | |
| - name: Start Xvfb | |
| run: | | |
| Xvfb :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
| echo "Started Xvfb display server" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: | | |
| echo "Current path: $(pwd)" | |
| cd e2e | |
| npm ci | |
| echo "Installed npm dependencies" | |
| - name: Install Playwright browsers | |
| run: | | |
| cd e2e | |
| npx playwright install --with-deps | |
| echo "Installed Playwright browsers" | |
| - name: Change MetaMask install-script permissions | |
| run: chmod +x ./e2e/script/prepare_browser.sh | |
| - name: Prepare MetaMask | |
| run: ./e2e/script/prepare_browser.sh | |
| - name: Run Playwright tests | |
| env: | |
| DISPLAY: :99 | |
| CI: true | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| WORKERS: 1 | |
| run: | | |
| cd e2e | |
| echo "Running Playwright tests..." | |
| # Debug information | |
| echo "Current directory: $(pwd)" | |
| echo "MetaMask extension directory exists: $(test -d ../e2e/metamask-extension && echo 'Yes' || echo 'No')" | |
| echo "Node version: $(node -v)" | |
| echo "NPM version: $(npm -v)" | |
| # Run a single test first to verify setup | |
| echo "Running a single test to verify setup..." | |
| # npx playwright test tests.spec.ts:17 --reporter=list --workers=1 --timeout=180000 || true | |
| # Run all tests with more conservative settings | |
| echo "Running all tests..." | |
| npx playwright test --reporter=list,github --workers=1 --timeout=180000 --retries=2 | |
| echo "All tests completed" | |
| # TEST_EXIT_CODE=$? | |
| # echo "Test execution completed with exit code $TEST_EXIT_CODE" | |
| # exit $TEST_EXIT_CODE | |
| - name: Upload test artifacts | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: e2e/test-results | |
| retention-days: 30 | |
| - name: Publish Test Report | |
| if: always() | |
| uses: mikepenz/action-junit-report@v5 | |
| with: | |
| report_paths: 'e2e/test-results/*.xml' | |
| check_name: Playwright Test Report | |
| fail_on_failure: false |