Add not found page #276
Workflow file for this run
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 | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| changes: | |
| permissions: | |
| pull-requests: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| e2e: ${{ steps.filter.outputs.e2e || steps.manual.outputs.e2e }} | |
| steps: | |
| - name: Determine changed paths | |
| if: github.event_name == 'pull_request' | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| e2e: | |
| - '.github/workflows/e2e.yml' | |
| - '.github/workflows/tern.conf' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| - 'database/**' | |
| - 'docs/**' | |
| - 'ocg-server/**' | |
| - 'tests/e2e/**' | |
| - name: Mark manual run as e2e-relevant | |
| if: github.event_name == 'workflow_dispatch' | |
| id: manual | |
| run: echo "e2e=true" >> "$GITHUB_OUTPUT" | |
| e2e-tests: | |
| name: ${{ matrix.suite }} | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.e2e == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - suite: Smoke | |
| command: npx playwright test --config playwright.config.ts --project=chromium-smoke --project=firefox-smoke --project=webkit-smoke | |
| artifact_name: playwright-artifacts-smoke | |
| - suite: Functional | |
| command: npx playwright test --config playwright.config.ts --project=chromium-deep --project=chromium-mobile-deep | |
| artifact_name: playwright-artifacts-deep | |
| - suite: Visual | |
| command: npx playwright test --config playwright.config.ts --grep @visual --project=chromium-deep --project=chromium-mobile-deep | |
| artifact_name: playwright-artifacts-visual | |
| permissions: | |
| contents: read | |
| services: | |
| postgres: | |
| image: postgis/postgis:17-3.5 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ocg_tests_e2e | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d ocg_tests_e2e" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| OCG_DB_HOST: 127.0.0.1 | |
| OCG_DB_NAME_TESTS_E2E: ocg_tests_e2e | |
| OCG_DB_PASSWORD: postgres | |
| OCG_E2E_BASE_URL: http://127.0.0.1:9001 | |
| OCG_E2E_MEETINGS_ENABLED: "true" | |
| OCG_E2E_PAYMENTS_ENABLED: "true" | |
| OCG_PG_BIN: /usr/bin | |
| PGPASSWORD: postgres | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.95.0 | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| - name: Install Node.js dependencies | |
| working-directory: tests/e2e | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: tests/e2e | |
| run: npx playwright install --with-deps | |
| - name: Install Tailwind CSS | |
| run: | | |
| curl -sL https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.10/tailwindcss-linux-x64 -o tailwindcss | |
| chmod +x tailwindcss | |
| sudo mv tailwindcss /usr/local/bin/tailwindcss | |
| - name: Install tern | |
| run: | | |
| curl -sL https://github.com/jackc/tern/releases/download/v2.3.2/tern_2.3.2_linux_amd64.tar.gz -o tern.tar.gz | |
| tar -xzf tern.tar.gz | |
| sudo mv tern /usr/local/bin/tern | |
| - name: Create e2e tern config | |
| run: | | |
| cat <<EOF >/tmp/ocg-tern-e2e.conf | |
| [database] | |
| host = 127.0.0.1 | |
| port = 5432 | |
| database = ocg_tests_e2e | |
| user = postgres | |
| password = postgres | |
| EOF | |
| - name: Recreate and migrate e2e database | |
| working-directory: database/migrations | |
| run: | | |
| dropdb -h 127.0.0.1 -p 5432 -U postgres --if-exists --force ocg_tests_e2e | |
| createdb -h 127.0.0.1 -p 5432 -U postgres ocg_tests_e2e | |
| psql -h 127.0.0.1 -p 5432 -U postgres ocg_tests_e2e -c "CREATE EXTENSION IF NOT EXISTS pgcrypto" | |
| psql -h 127.0.0.1 -p 5432 -U postgres ocg_tests_e2e -c "CREATE EXTENSION IF NOT EXISTS postgis" | |
| TERN_CONF=/tmp/ocg-tern-e2e.conf ./migrate.sh | |
| - name: Load e2e seed data | |
| run: | | |
| psql -h 127.0.0.1 -p 5432 -U postgres ocg_tests_e2e -f database/tests/data/e2e.sql | |
| psql -h 127.0.0.1 -p 5432 -U postgres ocg_tests_e2e -c "update \"user\" set password = '\$argon2id\$v=19\$m=19456,t=2,p=1\$q55jlxUx8bffhFM3xN36ZA\$te6OiWkZ/q35lpSEAZbd/A3iJyCByxbive9F61sTp7g' where username like 'e2e-%'" | |
| - name: Create e2e server config | |
| run: | | |
| cat <<EOF >/tmp/ocg-e2e.yml | |
| db: | |
| host: 127.0.0.1 | |
| port: 5432 | |
| dbname: ocg_tests_e2e | |
| user: postgres | |
| password: "postgres" | |
| email: | |
| from_address: noreply@test.com | |
| from_name: Test | |
| smtp: | |
| host: localhost | |
| port: 1025 | |
| username: "" | |
| password: "" | |
| images: | |
| provider: db | |
| payments: | |
| provider: stripe | |
| mode: test | |
| publishable_key: pk_test_e2e | |
| secret_key: sk_test_e2e | |
| webhook_secret: whsec_e2e | |
| meetings: | |
| zoom: | |
| account_id: account-id | |
| client_id: client-id | |
| client_secret: client-secret | |
| enabled: true | |
| host_pool_users: | |
| - host@example.com | |
| max_participants: 100 | |
| max_simultaneous_meetings_per_host: 1 | |
| webhook_secret_token: whsec_zoom_e2e | |
| server: | |
| addr: 127.0.0.1:9001 | |
| base_url: http://127.0.0.1:9001 | |
| cookie: | |
| secure: false | |
| disable_referer_checks: false | |
| login: | |
| email: true | |
| github: false | |
| linuxfoundation: false | |
| oauth2: {} | |
| oidc: {} | |
| EOF | |
| - name: Build e2e server binary | |
| run: cargo build --bin ocg-server | |
| - name: Start server and wait for it to be ready | |
| uses: JarvusInnovations/background-action@v1 | |
| with: | |
| run: ./target/debug/ocg-server -c /tmp/ocg-e2e.yml & | |
| wait-on: http://127.0.0.1:9001 | |
| tail: true | |
| log-output: "stdout,stderr" | |
| log-output-if: true | |
| - name: Run Playwright ${{ matrix.suite }} suite | |
| working-directory: tests/e2e | |
| run: ${{ matrix.command }} | |
| - name: Upload Playwright artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: | | |
| tests/e2e/playwright-report/ | |
| tests/e2e/test-results/ |