feat: migrate from Wails v2 to v3 #16
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: PR Validation | |
| on: | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=4096" | |
| GO_VERSION: "1.26" | |
| NODE_VERSION: "20" | |
| PNPM_VERSION: "10" | |
| jobs: | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # E2E Tests — Playwright against server mode | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Linux dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config xvfb | |
| version: 1.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| run_install: | | |
| - args: [] | |
| - args: [--global, typescript] | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| cache-dependency-path: "go.sum" | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| version: 3.x | |
| - name: Install Wails v3 | |
| run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest | |
| - name: Build workspace packages | |
| run: task packages | |
| - name: Install Playwright browsers | |
| working-directory: e2e | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Build and start server mode | |
| run: | | |
| task common:build:frontend | |
| go build -tags server -o bin/Omniview-server . | |
| bin/Omniview-server & | |
| echo "Waiting for server to be ready..." | |
| for i in $(seq 1 60); do | |
| if curl -sf http://localhost:34115/health > /dev/null 2>&1; then | |
| echo "Server ready" | |
| break | |
| fi | |
| sleep 2 | |
| done | |
| - name: Run Playwright tests | |
| working-directory: e2e | |
| run: pnpm test | |
| - name: Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: | | |
| e2e/playwright-report/ | |
| e2e/test-results/ | |
| retention-days: 7 | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Build Artifacts — downloadable binaries for manual testing | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| build-artifacts: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: darwin/universal | |
| artifact-name: pr-build-macos | |
| build-tags: "production" | |
| extra-ldflags: "" | |
| - os: ubuntu-latest | |
| platform: linux/amd64 | |
| artifact-name: pr-build-linux | |
| build-tags: "production,webkit2_41" | |
| extra-ldflags: "" | |
| - os: windows-latest | |
| platform: windows/amd64 | |
| artifact-name: pr-build-windows | |
| build-tags: "production" | |
| extra-ldflags: "-H windowsgui" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config | |
| version: 1.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| run_install: | | |
| - args: [] | |
| - args: [--global, typescript] | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| cache-dependency-path: "go.sum" | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| version: 3.x | |
| - name: Install Wails v3 | |
| shell: bash | |
| run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest | |
| - name: Build workspace packages | |
| shell: bash | |
| run: task packages | |
| - name: Build frontend | |
| shell: bash | |
| run: task common:build:frontend | |
| - name: Build Omniview | |
| shell: bash | |
| run: | | |
| go build -tags "${{ matrix.build-tags }}" -trimpath -buildvcs=false \ | |
| -ldflags "-w -s ${{ matrix.extra-ldflags }} \ | |
| -X github.com/omniviewdev/omniview/internal/version.Version=0.0.0-pr.${{ github.event.pull_request.number }} \ | |
| -X github.com/omniviewdev/omniview/internal/version.GitCommit=${{ github.sha }} \ | |
| -X github.com/omniviewdev/omniview/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) \ | |
| -X github.com/omniviewdev/omniview/internal/version.Development=true" \ | |
| -o bin/Omniview . | |
| - name: Prepare artifact (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| cd bin | |
| zip -r Omniview-pr${{ github.event.pull_request.number }}-macos.zip Omniview | |
| - name: Prepare artifact (Linux) | |
| if: runner.os == 'Linux' | |
| working-directory: bin | |
| run: mv Omniview "Omniview-pr${{ github.event.pull_request.number }}-linux-amd64" | |
| - name: Prepare artifact (Windows) | |
| if: runner.os == 'Windows' | |
| working-directory: bin | |
| run: Rename-Item -Path "Omniview" -NewName "Omniview-pr${{ github.event.pull_request.number }}-windows-amd64.exe" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact-name }} | |
| path: | | |
| bin/*.zip | |
| bin/Omniview-pr* | |
| if-no-files-found: error | |
| retention-days: 5 |