From ec8d3b68e3638797c04ae8d53543986772c82783 Mon Sep 17 00:00:00 2001 From: link1345 Date: Mon, 31 Aug 2026 15:32:19 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Unity=20CI=E3=82=92v3=E3=81=B8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gua-tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gua-tests.yml b/.github/workflows/gua-tests.yml index d48e883..cd9c196 100644 --- a/.github/workflows/gua-tests.yml +++ b/.github/workflows/gua-tests.yml @@ -20,12 +20,13 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository permissions: contents: read - uses: link1345/gua-tester/.github/workflows/unity.yml@v2.2 + uses: link1345/gua-tester/.github/workflows/unity.yml@v3 with: project-path: . scene-path: Assets/Scenes/Main.unity test-project: tests/GuaUiLab.Unity.Tests.csproj artifact-key: unity-sample + platform: WindowsX64 unity-version: auto gua-tag: gua-v1.18.0 artifact-path: artifacts/gua @@ -150,7 +151,7 @@ jobs: - name: Upload pull-request visual report if: github.event_name == 'pull_request' && steps.visual-outcome.outputs.value == 'failure' - uses: link1345/gua-tester/visual-report@v2.2 + uses: link1345/gua-tester/visual-report@v3 with: artifact-path: downloaded test-outcome: ${{ steps.visual-outcome.outputs.value }} @@ -161,7 +162,7 @@ jobs: - name: Prepare latest main visual report id: pages-report if: always() && (github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch') - uses: link1345/gua-tester/visual-report@v2.2 + uses: link1345/gua-tester/visual-report@v3 with: artifact-path: downloaded test-outcome: ${{ steps.visual-outcome.outputs.value }} From 4ac2f8958311efc6d45dbd450ce13355142d881c Mon Sep 17 00:00:00 2001 From: link1345 Date: Mon, 31 Aug 2026 16:29:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Gua=20v1.0.4=E3=81=A8gua-tester=20v3.1?= =?UTF-8?q?=E3=81=AB=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gua-tests.yml | 8 ++++---- Packages/com.link1345.gua/package.json | 2 +- README-ja.md | 10 +++++----- README.md | 10 +++++----- tests/GuaUiLab.Unity.Tests.csproj | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/gua-tests.yml b/.github/workflows/gua-tests.yml index cd9c196..af9083f 100644 --- a/.github/workflows/gua-tests.yml +++ b/.github/workflows/gua-tests.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository permissions: contents: read - uses: link1345/gua-tester/.github/workflows/unity.yml@v3 + uses: link1345/gua-tester/.github/workflows/unity.yml@v3.1 with: project-path: . scene-path: Assets/Scenes/Main.unity @@ -28,7 +28,7 @@ jobs: artifact-key: unity-sample platform: WindowsX64 unity-version: auto - gua-tag: gua-v1.18.0 + gua-tag: gua-v1.0.4 artifact-path: artifacts/gua secrets: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -151,7 +151,7 @@ jobs: - name: Upload pull-request visual report if: github.event_name == 'pull_request' && steps.visual-outcome.outputs.value == 'failure' - uses: link1345/gua-tester/visual-report@v3 + uses: link1345/gua-tester/visual-report@v3.1 with: artifact-path: downloaded test-outcome: ${{ steps.visual-outcome.outputs.value }} @@ -162,7 +162,7 @@ jobs: - name: Prepare latest main visual report id: pages-report if: always() && (github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch') - uses: link1345/gua-tester/visual-report@v3 + uses: link1345/gua-tester/visual-report@v3.1 with: artifact-path: downloaded test-outcome: ${{ steps.visual-outcome.outputs.value }} diff --git a/Packages/com.link1345.gua/package.json b/Packages/com.link1345.gua/package.json index 6a3182b..def6b6a 100644 --- a/Packages/com.link1345.gua/package.json +++ b/Packages/com.link1345.gua/package.json @@ -1,6 +1,6 @@ { "name": "com.link1345.gua", - "version": "1.18.0", + "version": "1.0.4", "displayName": "Gua Runtime UI Automation", "description": "Managed Unity adapter for the Gua runtime UI automation protocol.", "unity": "6000.0", diff --git a/README-ja.md b/README-ja.md index f28f3cf..d1e847e 100644 --- a/README-ja.md +++ b/README-ja.md @@ -9,7 +9,7 @@ ウィンドウはリサイズ可能です。541×857のデザイン比率を維持して一様に拡大・縮小し、画面比率から余る領域は黒いレターボックスとして表示します。 -UI自動化にはGua v1.18.0のUnity UPMパッケージを使用しています。実行中は既定で `ws://127.0.0.1:8765` にGua bridgeを開き、標準uGUIツリーを自動的に公開します。ポートは環境変数 `GUA_BRIDGE_PORT` で変更できます。 +UI自動化にはGua v1.0.4のUnity UPMパッケージを使用しています。実行中は既定で `ws://127.0.0.1:8765` にGua bridgeを開き、標準uGUIツリーを自動的に公開します。ポートは環境変数 `GUA_BRIDGE_PORT` で変更できます。 ## 実行 @@ -17,7 +17,7 @@ UI自動化にはGua v1.18.0のUnity UPMパッケージを使用しています 2. Unity `6000.5.3f1`で `Assets/Scenes/Main.unity` を開きます。 3. Playを押します。 -Guaの管理DLLとWindows x64ネイティブDLLを含む公式UPMパッケージ v1.18.0は `Packages/com.link1345.gua` に固定しています。そのため、隣接するGuaソースリポジトリへの参照や別途のパッケージダウンロードは不要です。 +Guaの管理DLLとWindows x64ネイティブDLLを含む公式UPMパッケージ v1.0.4は `Packages/com.link1345.gua` に固定しています。そのため、隣接するGuaソースリポジトリへの参照や別途のパッケージダウンロードは不要です。 ## UIテスト @@ -55,13 +55,13 @@ Remove-Item Env:GUA_VISUAL_REPORT_DEMO ## GitHub Actions -`.github/workflows/gua-tests.yml`で[`link1345/gua-tester`](https://github.com/link1345/gua-tester) v2.2を使用し、`main`へのpushとpull requestでUnity 6のWindows x64 Mono PlayerをビルドしてUIテストを実行します。Unity Playerのビルドにはrepository secretsの`UNITY_EMAIL`、`UNITY_PASSWORD`と、Personal用の`UNITY_LICENSE`またはProfessional用の`UNITY_SERIAL`が必要です。 +`.github/workflows/gua-tests.yml`で[`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1を使用し、`main`へのpushとpull requestでUnity 6のWindows x64 Mono PlayerをビルドしてUIテストを実行します。Unity Playerのビルドにはrepository secretsの`UNITY_EMAIL`、`UNITY_PASSWORD`と、Personal用の`UNITY_LICENSE`またはProfessional用の`UNITY_SERIAL`が必要です。 forkからのpull requestではUnity credentialsを渡さず、Unity jobをスキップします。`pull_request_target`は使用しません。 ### Visual差分Viewer -pull requestでVisual比較が失敗すると、`visual-report@v2.2`が`comparison.json`とPNGを静的Viewerへ変換し、`gua-visual-report`というActions artifactとして保存します。通常のUnity build log、Player、TRX、Gua診断・Visual成果物も`gua-tester` v2.2のworkflow artifactとして保存されます。 +pull requestでVisual比較が失敗すると、`visual-report@v3.1`が`comparison.json`とPNGを静的Viewerへ変換し、`gua-visual-report`というActions artifactとして保存します。通常のUnity build log、Player、TRX、Gua診断・Visual成果物も`gua-tester` v3.1のworkflow artifactとして保存されます。 `main`へのpushと手動実行では、最新結果をGitHub Pages artifactとしてアップロードし、専用jobからPagesへdeployします。repositoryのPages sourceを事前に **GitHub Actions** へ設定してください。 @@ -82,4 +82,4 @@ pull requestでVisual比較が失敗すると、`visual-report@v2.2`が`comparis | `cancel_exit` | button | 終了確認 | | `confirm_exit` | button | 終了確認 | -Gua v1.18.0で検証するUnity構成に合わせ、Windows x64・Monoを対象にしています。IL2CPPとWindows以外のPlayerはこのサンプルの検証対象外です。 +Gua v1.0.4で検証するUnity構成に合わせ、Windows x64・Monoを対象にしています。IL2CPPとWindows以外のPlayerはこのサンプルの検証対象外です。 diff --git a/README.md b/README.md index 37bb539..dd2c350 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is a Unity sample project for [Gua](https://github.com/link1345/gua). It re The window is resizable. The UI scales uniformly while preserving its 541×857 design aspect ratio, and any space outside that ratio is rendered as black letterboxing. -UI automation uses the Gua v1.18.0 Unity UPM package. At runtime, it opens a Gua bridge at `ws://127.0.0.1:8765` by default and automatically exposes the standard uGUI tree. Set the `GUA_BRIDGE_PORT` environment variable to use a different port. +UI automation uses the Gua v1.0.4 Unity UPM package. At runtime, it opens a Gua bridge at `ws://127.0.0.1:8765` by default and automatically exposes the standard uGUI tree. Set the `GUA_BRIDGE_PORT` environment variable to use a different port. ## Run the sample @@ -16,7 +16,7 @@ UI automation uses the Gua v1.18.0 Unity UPM package. At runtime, it opens a Gua 2. Open `Assets/Scenes/Main.unity` with Unity `6000.5.3f1`. 3. Enter Play Mode. -The official UPM package v1.18.0, including the managed assemblies and Windows x64 native libraries, is pinned in `Packages/com.link1345.gua`. No adjacent Gua source repository or separate package download is required. +The official UPM package v1.0.4, including the managed assemblies and Windows x64 native libraries, is pinned in `Packages/com.link1345.gua`. No adjacent Gua source repository or separate package download is required. ## UI tests @@ -54,13 +54,13 @@ Remove-Item Env:GUA_VISUAL_REPORT_DEMO ## GitHub Actions -`.github/workflows/gua-tests.yml` uses [`link1345/gua-tester`](https://github.com/link1345/gua-tester) v2.2 to build a Unity 6 Windows x64 Mono Player and run UI tests on pushes to `main` and on pull requests. Building the Unity Player requires the repository secrets `UNITY_EMAIL`, `UNITY_PASSWORD`, and either `UNITY_LICENSE` for a Personal license or `UNITY_SERIAL` for a Professional license. +`.github/workflows/gua-tests.yml` uses [`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1 to build a Unity 6 Windows x64 Mono Player and run UI tests on pushes to `main` and on pull requests. Building the Unity Player requires the repository secrets `UNITY_EMAIL`, `UNITY_PASSWORD`, and either `UNITY_LICENSE` for a Personal license or `UNITY_SERIAL` for a Professional license. Pull requests from forks do not receive Unity credentials, so the Unity job is skipped. The workflow does not use `pull_request_target`. ### Visual difference viewer -When a visual comparison fails in a pull request, `visual-report@v2.2` turns `comparison.json` and its PNGs into a static viewer and stores it as the `gua-visual-report` Actions artifact. The normal Unity build log, Player, TRX file, and Gua diagnostic and visual artifacts are also stored in the `gua-tester` v2.2 workflow artifact. +When a visual comparison fails in a pull request, `visual-report@v3.1` turns `comparison.json` and its PNGs into a static viewer and stores it as the `gua-visual-report` Actions artifact. The normal Unity build log, Player, TRX file, and Gua diagnostic and visual artifacts are also stored in the `gua-tester` v3.1 workflow artifact. On pushes to `main` and manual runs, the latest report is uploaded as a GitHub Pages artifact and deployed by a dedicated job. Configure the repository's Pages source as **GitHub Actions** first. @@ -81,4 +81,4 @@ Enable `visual-report-demo` in a manual run to reuse the Unity Player from the n | `cancel_exit` | button | Exit confirmation | | `confirm_exit` | button | Exit confirmation | -This sample targets Windows x64 and Mono, matching the validated Unity configuration in Gua v1.18.0. IL2CPP and non-Windows Players are outside the sample's validated scope. +This sample targets Windows x64 and Mono, matching the validated Unity configuration in Gua v1.0.4. IL2CPP and non-Windows Players are outside the sample's validated scope. diff --git a/tests/GuaUiLab.Unity.Tests.csproj b/tests/GuaUiLab.Unity.Tests.csproj index 1bfc0e0..58eb62c 100644 --- a/tests/GuaUiLab.Unity.Tests.csproj +++ b/tests/GuaUiLab.Unity.Tests.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + From da87f64631a959f39821d4acd4227b06da8ea7e9 Mon Sep 17 00:00:00 2001 From: link1345 Date: Mon, 31 Aug 2026 19:04:27 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Unity=20CI=E3=82=92Linux=E3=81=B8=E7=A7=BB?= =?UTF-8?q?=E8=A1=8C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gua-tests.yml | 25 ++++++------------------- README-ja.md | 6 +++--- README.md | 6 +++--- tests/AdvancedValidationTests.cs | 6 ++++-- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/gua-tests.yml b/.github/workflows/gua-tests.yml index af9083f..1ca0173 100644 --- a/.github/workflows/gua-tests.yml +++ b/.github/workflows/gua-tests.yml @@ -26,7 +26,7 @@ jobs: scene-path: Assets/Scenes/Main.unity test-project: tests/GuaUiLab.Unity.Tests.csproj artifact-key: unity-sample - platform: WindowsX64 + platform: LinuxX64 unity-version: auto gua-tag: gua-v1.0.4 artifact-path: artifacts/gua @@ -39,7 +39,7 @@ jobs: visual-report-demo: needs: unity-tests if: github.event_name == 'workflow_dispatch' && inputs.visual-report-demo && needs.unity-tests.result == 'success' - runs-on: windows-latest + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - name: Check out repository @@ -50,20 +50,6 @@ jobs: with: dotnet-version: 10.0.x - - name: Set deterministic Windows display resolution - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - if ($null -eq (Get-Command Set-DisplayResolution -ErrorAction SilentlyContinue)) { - throw "Set-DisplayResolution is unavailable on this Windows runner image." - } - Set-DisplayResolution -Width 1920 -Height 1080 -Force - Add-Type -AssemblyName System.Windows.Forms - $bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds - if ($bounds.Width -ne 1920 -or $bounds.Height -ne 1080) { - throw "Windows display resolution is $($bounds.Width)x$($bounds.Height); expected 1920x1080." - } - - name: Download Unity Player uses: actions/download-artifact@v4 with: @@ -74,14 +60,15 @@ jobs: id: player shell: pwsh run: | - $player = Get-ChildItem -LiteralPath artifacts/unity-player -Filter GuaPlayer.exe -Recurse -File | Select-Object -First 1 + $player = Get-ChildItem -LiteralPath artifacts/unity-player -Filter GuaPlayer -Recurse -File | Select-Object -First 1 if ($null -eq $player) { throw "Downloaded Unity Player executable was not found." } + chmod +x $player.FullName "path=$($player.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Restore Unity tests - shell: pwsh + shell: bash run: dotnet restore tests/GuaUiLab.Unity.Tests.csproj - name: Generate intentional Unity visual difference @@ -91,7 +78,7 @@ jobs: GUA_UNITY_ARTIFACT_PLAYER: ${{ steps.player.outputs.path }} GUA_VISUAL_REPORT_DEMO: "1" run: >- - dotnet test tests/GuaUiLab.Unity.Tests.csproj + xvfb-run --auto-servernum dotnet test tests/GuaUiLab.Unity.Tests.csproj --configuration Release --no-restore --filter VisualReportViewerDemoProducesPixelDifferenceArtifact diff --git a/README-ja.md b/README-ja.md index d1e847e..efd3419 100644 --- a/README-ja.md +++ b/README-ja.md @@ -17,7 +17,7 @@ UI自動化にはGua v1.0.4のUnity UPMパッケージを使用しています 2. Unity `6000.5.3f1`で `Assets/Scenes/Main.unity` を開きます。 3. Playを押します。 -Guaの管理DLLとWindows x64ネイティブDLLを含む公式UPMパッケージ v1.0.4は `Packages/com.link1345.gua` に固定しています。そのため、隣接するGuaソースリポジトリへの参照や別途のパッケージダウンロードは不要です。 +Guaの管理DLLとWindows/Linux x64 native libraryを含む公式UPMパッケージ v1.0.4は `Packages/com.link1345.gua` に固定しています。そのため、隣接するGuaソースリポジトリへの参照や別途のパッケージダウンロードは不要です。 ## UIテスト @@ -55,7 +55,7 @@ Remove-Item Env:GUA_VISUAL_REPORT_DEMO ## GitHub Actions -`.github/workflows/gua-tests.yml`で[`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1を使用し、`main`へのpushとpull requestでUnity 6のWindows x64 Mono PlayerをビルドしてUIテストを実行します。Unity Playerのビルドにはrepository secretsの`UNITY_EMAIL`、`UNITY_PASSWORD`と、Personal用の`UNITY_LICENSE`またはProfessional用の`UNITY_SERIAL`が必要です。 +`.github/workflows/gua-tests.yml`で[`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1を使用し、`main`へのpushとpull requestでUnity 6のLinux x64 Mono Playerをビルドし、Xvfb上でUIテストを実行します。Unity Playerのビルドにはrepository secretsの`UNITY_EMAIL`、`UNITY_PASSWORD`と、Personal用の`UNITY_LICENSE`またはProfessional用の`UNITY_SERIAL`が必要です。 forkからのpull requestではUnity credentialsを渡さず、Unity jobをスキップします。`pull_request_target`は使用しません。 @@ -82,4 +82,4 @@ pull requestでVisual比較が失敗すると、`visual-report@v3.1`が`comparis | `cancel_exit` | button | 終了確認 | | `confirm_exit` | button | 終了確認 | -Gua v1.0.4で検証するUnity構成に合わせ、Windows x64・Monoを対象にしています。IL2CPPとWindows以外のPlayerはこのサンプルの検証対象外です。 +Gua v1.0.4のクロスプラットフォームUnity構成に合わせ、CIではLinux x64・Monoを対象にしています。IL2CPPはこのサンプルの検証対象外です。 diff --git a/README.md b/README.md index dd2c350..d90e2a1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ UI automation uses the Gua v1.0.4 Unity UPM package. At runtime, it opens a Gua 2. Open `Assets/Scenes/Main.unity` with Unity `6000.5.3f1`. 3. Enter Play Mode. -The official UPM package v1.0.4, including the managed assemblies and Windows x64 native libraries, is pinned in `Packages/com.link1345.gua`. No adjacent Gua source repository or separate package download is required. +The official UPM package v1.0.4, including the managed assemblies and Windows and Linux x64 native libraries, is pinned in `Packages/com.link1345.gua`. No adjacent Gua source repository or separate package download is required. ## UI tests @@ -54,7 +54,7 @@ Remove-Item Env:GUA_VISUAL_REPORT_DEMO ## GitHub Actions -`.github/workflows/gua-tests.yml` uses [`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1 to build a Unity 6 Windows x64 Mono Player and run UI tests on pushes to `main` and on pull requests. Building the Unity Player requires the repository secrets `UNITY_EMAIL`, `UNITY_PASSWORD`, and either `UNITY_LICENSE` for a Personal license or `UNITY_SERIAL` for a Professional license. +`.github/workflows/gua-tests.yml` uses [`link1345/gua-tester`](https://github.com/link1345/gua-tester) v3.1 to build a Unity 6 Linux x64 Mono Player and run UI tests under Xvfb on pushes to `main` and on pull requests. Building the Unity Player requires the repository secrets `UNITY_EMAIL`, `UNITY_PASSWORD`, and either `UNITY_LICENSE` for a Personal license or `UNITY_SERIAL` for a Professional license. Pull requests from forks do not receive Unity credentials, so the Unity job is skipped. The workflow does not use `pull_request_target`. @@ -81,4 +81,4 @@ Enable `visual-report-demo` in a manual run to reuse the Unity Player from the n | `cancel_exit` | button | Exit confirmation | | `confirm_exit` | button | Exit confirmation | -This sample targets Windows x64 and Mono, matching the validated Unity configuration in Gua v1.0.4. IL2CPP and non-Windows Players are outside the sample's validated scope. +This sample's CI targets Linux x64 and Mono, matching the cross-platform Unity configuration in Gua v1.0.4. IL2CPP remains outside the sample's validated scope. diff --git a/tests/AdvancedValidationTests.cs b/tests/AdvancedValidationTests.cs index 12e50ce..0293c5a 100644 --- a/tests/AdvancedValidationTests.cs +++ b/tests/AdvancedValidationTests.cs @@ -14,7 +14,9 @@ public sealed class AdvancedValidationTests private const int RenderedHeight = 700; private static readonly string VisualVariant = Environment.GetEnvironmentVariable("GUA_VISUAL_VARIANT") - ?? "windows-unity-6000.5.3f1-d3d11-541x700"; + ?? (OperatingSystem.IsLinux() + ? "unity-LinuxX64" + : "windows-unity-6000.5.3f1-d3d11-541x700"); private static readonly TimeSpan ShortTimeout = TimeSpan.FromSeconds(5); private static readonly TimeSpan RecordingActionTimeout = TimeSpan.FromSeconds(15); private static readonly TimeSpan PollInterval = TimeSpan.FromMilliseconds(20); @@ -76,7 +78,7 @@ await GuaAssertions.WaitForVisibleAsync( "visual-report-demo-baselines"); var artifactDirectory = Path.Combine(ProjectRoot, "artifacts", "gua"); const string comparisonName = "visual-report-viewer-demo"; - const string variant = "windows-unity-6000.5.3f1-d3d11-541x700"; + var variant = VisualVariant; var comparisonArtifactDirectory = Path.Combine(artifactDirectory, comparisonName); await GuaVisualAssertions.ExpectScreenshotAsync(