migrate connection-related logic to backend #65
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main, dev, 'release/**'] | |
| paths-ignore: ['*.md', 'LICENSE'] | |
| pull_request: | |
| branches: [main, dev, 'release/**'] | |
| paths-ignore: ['*.md', 'LICENSE'] | |
| concurrency: | |
| group: e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e: | |
| runs-on: [self-hosted, Linux, X64] | |
| timeout-minutes: 90 | |
| container: | |
| image: ubuntu:24.04 | |
| options: --privileged | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| CLIENT_BINARY: ${{ github.workspace }}/src-tauri/target/release/defguard-client | |
| NATIVE_DRIVER: /usr/bin/WebKitWebDriver | |
| SQLX_OFFLINE: '1' | |
| RUSTC_WRAPPER: sccache | |
| SCCACHE_GHA_ENABLED: 'true' | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y git curl ca-certificates build-essential \ | |
| libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev \ | |
| librsvg2-dev patchelf libssl-dev libxdo-dev protobuf-compiler \ | |
| libprotobuf-dev webkit2gtk-driver xvfb wireguard-tools iproute2 \ | |
| iputils-ping procps xclip desktop-file-utils xdg-utils | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| cache: true | |
| version: 11.11 | |
| run_install: false | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install sccache | |
| uses: mozilla-actions/sccache-action@v0.0.10 | |
| - name: Install tauri-driver | |
| run: cargo install tauri-driver --locked | |
| - name: Build new-ui | |
| run: pnpm install --no-frozen-lockfile && pnpm build | |
| working-directory: new-ui | |
| - name: Build client | |
| run: pnpm install --no-frozen-lockfile && pnpm tauri build | |
| - name: Prepare e2e environment | |
| run: | | |
| cp e2e/.env.example e2e/.env | |
| echo "CORE_URL=${{ secrets.E2E_CORE_URL }}" >> e2e/.env | |
| echo "PROXY_URL=${{ secrets.E2E_PROXY_URL }}" >> e2e/.env | |
| echo "CORE_ADMIN_PASSWORD=${{ secrets.E2E_CORE_ADMIN_PASSWORD }}" >> e2e/.env | |
| echo "NETWORK_ENDPOINT=${{ secrets.E2E_NETWORK_ENDPOINT }}" >> e2e/.env | |
| - name: Check deployment is reachable | |
| run: curl -sf --max-time 15 "${{ secrets.E2E_CORE_URL }}/api/v1/health" | |
| - name: Stub resolvconf | |
| run: | | |
| printf '#!/bin/sh\ncat >/dev/null 2>&1 || true\nexit 0\n' > /usr/local/sbin/resolvconf | |
| chmod +x /usr/local/sbin/resolvconf | |
| - name: Start defguard-service | |
| run: | | |
| groupadd -f defguard | |
| modprobe wireguard || true | |
| setsid src-tauri/target/release/defguard-service < /dev/null & | |
| for _ in $(seq 1 40); do [ -S /var/run/defguard.socket ] && break; sleep 0.5; done | |
| test -S /var/run/defguard.socket | |
| - name: Install e2e dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| working-directory: e2e | |
| - name: Provision core (network + gateway check) | |
| run: pnpm provision | |
| working-directory: e2e | |
| - name: Run e2e tests | |
| run: xvfb-run -a pnpm test | |
| working-directory: e2e | |
| lint-e2e: | |
| runs-on: | |
| - codebuild-defguard-client-runner-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 11.11 | |
| run_install: false | |
| - name: Install e2e dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| working-directory: e2e | |
| - name: Lint e2e | |
| run: pnpm lint | |
| working-directory: e2e |