From 5782e184bcf91e731dc94fafab5e02746dab02a9 Mon Sep 17 00:00:00 2001 From: RyodoTanaka Date: Wed, 9 Oct 2024 11:41:42 +0900 Subject: [PATCH 1/3] Update to test unity2020.3.x to 2022.3.x --- .github/workflows/main.yml | 97 +++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9d3e877..1889d2ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,51 +1,80 @@ -# This is a basic workflow to help you get started with Actions +name: CI check for Unity 2020.3.x, 2021.3.x, 2022.3.x -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: pull_request: branches: - - master - - develop - -env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + - master + - beta/** jobs: - testAllModes: - name: Test in ${{ matrix.testMode }} on version ${{ matrix.unityVersion }} + test: + name: Test on Unity ${{ matrix.unityVersion }} runs-on: ubuntu-latest + strategy: fail-fast: false matrix: - projectPath: - - ./ unityVersion: - - 2020.1.13f1 - testMode: - - all -# - playmode -# - editmode + - 2020.3.48f1 + - 2021.3.42f1 + - 2022.3.42f1 + steps: - - uses: actions/checkout@v2 + # リポジトリをチェックアウト + - name: Checkout repository + uses: actions/checkout@v4 + with: + lfs: true # Large File Storageが必要な場合に true を指定 + + - name: Set up Unity version-specific Packages and ProjectSettings + run: | + if [[ "${{ matrix.unityVersion }}" == "2020.3.48f1" ]]; then + cp -r .ProjectSettings2020 ProjectSettings + cp -r .Packages2020 Packages + elif [[ "${{ matrix.unityVersion }}" == "2021.3.42f1" ]]; then + cp -r .ProjectSettings2021 ProjectSettings + cp -r .Packages2021 Packages + elif [[ "${{ matrix.unityVersion }}" == "2022.3.42f1" ]]; then + cp -r .ProjectSettings2022 ProjectSettings + cp -r .Packages2022 Packages + fi + + # Unity Test Runnerを実行 (エディットモードテスト) + - name: Run Edit Mode Tests + uses: game-ci/unity-test-runner@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: - lfs: true - - uses: actions/cache@v1.1.0 + projectPath: ./ + unityVersion: ${{ matrix.unityVersion }} + customParameters: -runTests -testPlatform editmode + artifactsPath: editmode-results + + # アーティファクトのアップロード(エディットモード) + - name: Upload Edit Mode Test results for ${{ matrix.unityVersion }} + uses: actions/upload-artifact@v4 with: - path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }} - restore-keys: | - Library- - - uses: webbertakken/unity-test-runner@v1.4 - id: tests + name: Edit Mode Test results for Unity ${{ matrix.unityVersion }} + path: editmode-results + + # Unity Test Runnerを実行 (プレイモードテスト) + - name: Run Play Mode Tests + uses: game-ci/unity-test-runner@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: - projectPath: ${{ matrix.projectPath }} + projectPath: ./ unityVersion: ${{ matrix.unityVersion }} - testMode: ${{ matrix.testMode }} - artifactsPath: ${{ matrix.testMode }}-artifacts - - uses: actions/upload-artifact@v1 + customParameters: -runTests -testPlatform playmode + artifactsPath: playmode-results + + # アーティファクトのアップロード(プレイモード) + - name: Upload Play Mode Test results for ${{ matrix.unityVersion }} + uses: actions/upload-artifact@v4 with: - name: Test results for ${{ matrix.testMode }} - path: ${{ steps.tests.outputs.artifactsPath }} + name: Play Mode Test results for Unity ${{ matrix.unityVersion }} + path: playmode-results From 8d41a653821c6467499109090da57426d385489a Mon Sep 17 00:00:00 2001 From: RyodoTanaka Date: Wed, 9 Oct 2024 11:45:35 +0900 Subject: [PATCH 2/3] Delete unnecessary files --- .github/workflows/activation.yml | 22 ---------------------- .github/workflows/activation2020.yml | 22 ---------------------- .github/workflows/activation2021.yml | 22 ---------------------- .github/workflows/activation2022.yml | 22 ---------------------- 4 files changed, 88 deletions(-) delete mode 100644 .github/workflows/activation.yml delete mode 100644 .github/workflows/activation2020.yml delete mode 100644 .github/workflows/activation2021.yml delete mode 100644 .github/workflows/activation2022.yml diff --git a/.github/workflows/activation.yml b/.github/workflows/activation.yml deleted file mode 100644 index 9825a8b8..00000000 --- a/.github/workflows/activation.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Acquire activation file -on: - pull_request: - branches: - - master -jobs: - activation: - name: Request manual activation file 🔑 - runs-on: ubuntu-latest - steps: - # Request manual activation file - - name: Request manual activation file - id: getManualLicenseFile - uses: webbertakken/unity-request-manual-activation-file@v1.1 - with: - unityVersion: 2020.1.13f1 - # Upload artifact (Unity_v20XX.X.XXXX.alf) - - name: Expose as artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ steps.getManualLicenseFile.outputs.filePath }} - path: ${{ steps.getManualLicenseFile.outputs.filePath }} diff --git a/.github/workflows/activation2020.yml b/.github/workflows/activation2020.yml deleted file mode 100644 index 2a4409ad..00000000 --- a/.github/workflows/activation2020.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Acquire activation file for 2020 - -on: - workflow_dispatch: {} - -jobs: - activation: - name: Request manual activation file 🔑 - runs-on: ubuntu-latest - steps: - # Request manual activation file - - name: Request manual activation file - id: getManualLicenseFile - uses: game-ci/unity-request-activation-file@v2 - with: - unityVersion: 2020.3.48f1 - # Upload artifact (Unity_v20XX.X.XXXX.alf) - - name: Expose as artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.getManualLicenseFile.outputs.filePath }} - path: ${{ steps.getManualLicenseFile.outputs.filePath }} diff --git a/.github/workflows/activation2021.yml b/.github/workflows/activation2021.yml deleted file mode 100644 index cfe85c2c..00000000 --- a/.github/workflows/activation2021.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Acquire activation file for 2021 - -on: - workflow_dispatch: {} - -jobs: - activation: - name: Request manual activation file 🔑 - runs-on: ubuntu-latest - steps: - # Request manual activation file - - name: Request manual activation file - id: getManualLicenseFile - uses: game-ci/unity-request-activation-file@v2 - with: - unityVersion: 2021.3.28f1 - # Upload artifact (Unity_v20XX.X.XXXX.alf) - - name: Expose as artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.getManualLicenseFile.outputs.filePath }} - path: ${{ steps.getManualLicenseFile.outputs.filePath }} diff --git a/.github/workflows/activation2022.yml b/.github/workflows/activation2022.yml deleted file mode 100644 index 758a6483..00000000 --- a/.github/workflows/activation2022.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Acquire activation file for 2022 - -on: - workflow_dispatch: {} - -jobs: - activation: - name: Request manual activation file 🔑 - runs-on: ubuntu-latest - steps: - # Request manual activation file - - name: Request manual activation file - id: getManualLicenseFile - uses: game-ci/unity-request-activation-file@v2 - with: - unityVersion: 2022.3.4f1 - # Upload artifact (Unity_v20XX.X.XXXX.alf) - - name: Expose as artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.getManualLicenseFile.outputs.filePath }} - path: ${{ steps.getManualLicenseFile.outputs.filePath }} From 46e18753d6b1097009570b47e3f082c65b667aff Mon Sep 17 00:00:00 2001 From: RyodoTanaka Date: Wed, 9 Oct 2024 11:45:44 +0900 Subject: [PATCH 3/3] Fix to delete unnecessary file copy --- .github/workflows/main.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1889d2ab..549582c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,19 +25,6 @@ jobs: uses: actions/checkout@v4 with: lfs: true # Large File Storageが必要な場合に true を指定 - - - name: Set up Unity version-specific Packages and ProjectSettings - run: | - if [[ "${{ matrix.unityVersion }}" == "2020.3.48f1" ]]; then - cp -r .ProjectSettings2020 ProjectSettings - cp -r .Packages2020 Packages - elif [[ "${{ matrix.unityVersion }}" == "2021.3.42f1" ]]; then - cp -r .ProjectSettings2021 ProjectSettings - cp -r .Packages2021 Packages - elif [[ "${{ matrix.unityVersion }}" == "2022.3.42f1" ]]; then - cp -r .ProjectSettings2022 ProjectSettings - cp -r .Packages2022 Packages - fi # Unity Test Runnerを実行 (エディットモードテスト) - name: Run Edit Mode Tests