From dc953e9a37e10986b77fb361d867cd2c313c0260 Mon Sep 17 00:00:00 2001 From: Sokuhatiku Date: Fri, 5 Jan 2024 00:50:38 +0900 Subject: [PATCH] Add windows runner tests --- .github/workflows/main.yml | 74 +++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96e55d7..30deaaa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,11 +27,15 @@ jobs: # - run: yarn build --quiet && git diff --quiet action || { echo "ERROR - index.js is different from repository version. Forgot to run `yarn build`?" ; exit 62; } testAllModesLikeInTheReadme: - name: Test in ${{ matrix.testMode }} on version ${{ matrix.unityVersion }} - runs-on: ubuntu-latest + name: Test in ${{ matrix.testMode }} of version ${{ matrix.unityVersion }} on ${{ matrix.baseRunner }} + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false + max-parallel: 2 matrix: + baseRunner: + - ubuntu-latest + - windows-latest projectPath: - unity-project-with-correct-tests unityVersion: @@ -57,9 +61,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library- + Library-${{ matrix.baseRunner }} - uses: ./ id: tests with: @@ -76,10 +80,13 @@ jobs: testRunnerInAllModes: name: Test all modes โœจ - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest projectPath: - unity-project-with-correct-tests unityVersion: @@ -100,10 +107,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }} # Configure test runner - name: Run tests @@ -134,10 +140,13 @@ jobs: testRunnerInEditMode: name: Test edit mode ๐Ÿ“ - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest unityVersion: - 2022.3.13f1 - 2023.1.19f1 @@ -161,10 +170,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }} # Configure test runner - name: Run tests @@ -195,10 +203,13 @@ jobs: testRunnerInPlayMode: name: Test play mode ๐Ÿ“บ - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest projectPath: - unity-project-with-correct-tests unityVersion: @@ -219,10 +230,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }} # Configure test runner - name: Run tests @@ -252,10 +262,13 @@ jobs: testRunnerInStandalone: name: Test standalone ๐Ÿ“บ - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest projectPath: - unity-project-with-correct-tests unityVersion: @@ -276,10 +289,10 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }}- + Library-${{ matrix.baseRunner }}- # Configure test runner - name: Run tests @@ -301,10 +314,13 @@ jobs: testRunnerInStandaloneWithIL2CPP: name: Test standalone with IL2CPP ๐Ÿ“บ - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest projectPath: - unity-project-with-correct-tests unityVersion: @@ -325,10 +341,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }}- # Set scripting backend to IL2CPP - name: Rewrite ProjectSettings @@ -336,6 +351,7 @@ jobs: DefineOriginal=" scriptingBackend: {}" DefineReplace=" scriptingBackend: \\n Standalone: 1" sed -i "{s/$DefineOriginal/$DefineReplace/g}" ${{ matrix.projectPath }}/ProjectSettings/ProjectSettings.asset + shell: bash # Configure test runner - name: Run tests @@ -357,10 +373,13 @@ jobs: testEachModeSequentially: name: Test each mode sequentially ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ # don't try this at home (it's much slower) - runs-on: ubuntu-latest + runs-on: ${{ matrix.baseRunner }} strategy: fail-fast: false matrix: + baseRunner: + - ubuntu-latest + - windows-latest unityVersion: - 2022.3.13f1 - 2023.1.19f1 @@ -381,10 +400,9 @@ jobs: - uses: actions/cache@v3 with: path: ${{ matrix.projectPath }}/Library - key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} + key: Library-${{ matrix.baseRunner }}-${{ matrix.projectPath }} restore-keys: | - Library-${{ matrix.projectPath }}- - Library- + Library-${{ matrix.baseRunner }}- # Configure first test runner - name: Tests in editmode ๐Ÿ“