From ffc56dbec6c1164ae6874968b4536db93efa50b5 Mon Sep 17 00:00:00 2001 From: kkostenkov Date: Sun, 5 May 2024 22:50:29 +0200 Subject: [PATCH 1/3] Move built project to isolated directory --- .github/workflows/check-code-style.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml index a5fe41f..905c6ad 100644 --- a/.github/workflows/check-code-style.yml +++ b/.github/workflows/check-code-style.yml @@ -48,11 +48,13 @@ jobs: # Inspect code instalation could not add itself to path. Doing it before manually. - run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH + # dotnet tool update --global JetBrains.ReSharper.GlobalTools fails to run if pwd contains several projetcs + - run: mkdir UnityProjectIsolated; mv -v ${{ env.PROJECT_PATH }}/* UnityProjectIsolated/ - name: Inspect code uses: muno92/resharper_inspectcode@v1 with: - solutionPath: ${{ env.PROJECT_PATH }}${{ env.PROJECT_NAME }}.sln + solutionPath: UnityProjectIsolated/${{ env.PROJECT_NAME }}.sln solutionWideAnalysis: false minimumReportSeverity: warning minimumSeverity: warning From 7b80a6edff7afdc35f4c4f52f7bab0c9f7736ae5 Mon Sep 17 00:00:00 2001 From: kkostenkov Date: Sun, 5 May 2024 22:52:33 +0200 Subject: [PATCH 2/3] Remove local step's env decalarations --- .github/workflows/check-code-style.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml index 905c6ad..97b2f84 100644 --- a/.github/workflows/check-code-style.yml +++ b/.github/workflows/check-code-style.yml @@ -8,6 +8,7 @@ on: env: PROJECT_NAME: UnityProject PROJECT_PATH: "UnityProject/" + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} jobs: inspection: @@ -28,18 +29,11 @@ jobs: restore-keys: Library-lint- - name: Generate Solution - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} - run: unity-editor -batchmode -nographics -logFile /dev/stdout -projectPath ${{ env.PROJECT_PATH }} -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" -serial "$UNITY_SERIAL" -quit + run: unity-editor -batchmode -nographics -logFile /dev/stdout -projectPath ${{ env.PROJECT_PATH }} -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -serial "$UNITY_SERIAL" -quit - - name: Return License - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + - name: Return License if: always() - run: unity-editor -logFile /dev/stdout -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" -quit -returnlicense + run: unity-editor -logFile /dev/stdout -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -quit -returnlicense - name: Setup .NET uses: actions/setup-dotnet@v3 From 9d77bd5c24d1fb45c480e4c2b65f6a7cbfc1b252 Mon Sep 17 00:00:00 2001 From: kkostenkov Date: Mon, 6 May 2024 06:44:15 +0200 Subject: [PATCH 3/3] Try unity-builder again --- .github/workflows/check-code-style.yml | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml index 97b2f84..5030f20 100644 --- a/.github/workflows/check-code-style.yml +++ b/.github/workflows/check-code-style.yml @@ -8,7 +8,7 @@ on: env: PROJECT_NAME: UnityProject PROJECT_PATH: "UnityProject/" - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + TARGET_PLATFORM: "Android" jobs: inspection: @@ -28,23 +28,28 @@ jobs: key: Library-lint-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} restore-keys: Library-lint- - - name: Generate Solution - run: unity-editor -batchmode -nographics -logFile /dev/stdout -projectPath ${{ env.PROJECT_PATH }} -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -serial "$UNITY_SERIAL" -quit + - uses: game-ci/unity-builder@v4 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} # Unity professional + #UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # Unity personal + with: + targetPlatform: ${{ env.TARGET_PLATFORM }} + projectPath: ${{ env.PROJECT_PATH }} + buildMethod: Packages.Rider.Editor.RiderScriptEditor.SyncSolution + #unityLicensingServer: [url to your license server] - - name: Return License - if: always() - run: unity-editor -logFile /dev/stdout -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -quit -returnlicense - - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x - # Inspect code instalation could not add itself to path. Doing it before manually. - - run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - # dotnet tool update --global JetBrains.ReSharper.GlobalTools fails to run if pwd contains several projetcs + # dotnet tool update fails to run if pwd contains several projetcs - run: mkdir UnityProjectIsolated; mv -v ${{ env.PROJECT_PATH }}/* UnityProjectIsolated/ - + + # Inspect code instalation could not add itself to path. Doing it before manually. + - run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH - name: Inspect code uses: muno92/resharper_inspectcode@v1 with: