mirror of
https://github.com/game-ci/unity-actions.git
synced 2026-01-29 04:39:07 +08:00
fix typo, upgrade test-runner, add advanced example
This commit is contained in:
155
.github/workflows/main.yml
vendored
155
.github/workflows/main.yml
vendored
@@ -9,38 +9,41 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
readmeWorkflow:
|
readmeWorkflow:
|
||||||
# Checkout
|
name: Readme Workflow ✨
|
||||||
- name: Checkout repository
|
runs-on: ubuntu-latest
|
||||||
uses: actions/checkout@v2
|
steps:
|
||||||
with:
|
# Checkout
|
||||||
lfs: true
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
|
||||||
# Cache
|
# Cache
|
||||||
- uses: actions/cache@v1.1.0
|
- uses: actions/cache@v1.1.0
|
||||||
with:
|
with:
|
||||||
path: test-project/Library
|
path: test-project/Library
|
||||||
key: Library-test-project-WebGL
|
key: Library-test-project-WebGL
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: webbertakken/unity-test-runner@v1.2
|
uses: webbertakken/unity-test-runner@v1.2
|
||||||
with:
|
with:
|
||||||
projectPath: test-project
|
projectPath: test-project
|
||||||
unityVersion: 2019.2.11f1
|
unityVersion: 2019.2.11f1
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
- name: Build project
|
- name: Build project
|
||||||
uses: webbertakken/unity-builder@v0.9
|
uses: webbertakken/unity-builder@v0.9
|
||||||
with:
|
with:
|
||||||
projectPath: test-project
|
projectPath: test-project
|
||||||
unityVersion: 2019.2.11f1
|
unityVersion: 2019.2.11f1
|
||||||
targetPlatform: WebGL
|
targetPlatform: WebGL
|
||||||
|
|
||||||
# Output
|
# Output
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: Build
|
name: Build
|
||||||
path: build
|
path: build
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of readme workflow.
|
# End of readme workflow.
|
||||||
@@ -61,19 +64,16 @@ jobs:
|
|||||||
- 2019.2.17f1
|
- 2019.2.17f1
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository
|
# Checkout repository
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Request manual activation file
|
# Request manual activation file
|
||||||
- name: Request manual activation file
|
- uses: webbertakken/unity-request-manual-activation-file@v1.1
|
||||||
id: getManualLicenseFile
|
id: getManualLicenseFile
|
||||||
uses: webbertakken/unity-request-manual-activation-file@v1.1
|
|
||||||
with:
|
with:
|
||||||
unityVersion: ${{ matrix.unityVersion }}
|
unityVersion: ${{ matrix.unityVersion }}
|
||||||
|
|
||||||
# Upload artifact (Unity_v20XX.X.XXXX.alf)
|
# Upload artifact (Unity_v20XX.X.XXXX.alf)
|
||||||
- name: Expose as artifact
|
- uses: actions/upload-artifact@v1
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
with:
|
||||||
name: Manual Activation File
|
name: Manual Activation File
|
||||||
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
|
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
|
||||||
@@ -82,39 +82,23 @@ jobs:
|
|||||||
name: Request activation ✔
|
name: Request activation ✔
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository
|
- uses: actions/checkout@v2
|
||||||
- name: Checkout repository
|
- uses: webbertakken/unity-activate@v1.2
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Activate Unity
|
|
||||||
- name: Unity - Activate
|
|
||||||
uses: webbertakken/unity-activate@v1.2
|
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
|
|
||||||
activateAndThenReturnLicense:
|
activateAndThenReturnLicense:
|
||||||
name: returnLicense 🎈
|
name: returnLicense 🎈
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository (required to test local actions)
|
- uses: actions/checkout@v2
|
||||||
- name: Checkout repository
|
- uses: webbertakken/unity-activate@v1.2
|
||||||
uses: actions/checkout@v2
|
- uses: webbertakken/unity-return-license@v1
|
||||||
|
|
||||||
# Activate Unity
|
|
||||||
- name: Activate Unity
|
|
||||||
uses: webbertakken/unity-activate@v1.2
|
|
||||||
|
|
||||||
# Return License
|
|
||||||
- name: Return license
|
|
||||||
uses: webbertakken/unity-return-license@v0.1
|
|
||||||
|
|
||||||
testRunnerInEditMode:
|
testRunnerInEditMode:
|
||||||
name: Test in editmode 📝
|
name: Test in editmode 📝
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository (required to test local actions)
|
# Checkout repository (required to test local actions)
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
@@ -128,17 +112,14 @@ jobs:
|
|||||||
Library-
|
Library-
|
||||||
|
|
||||||
# Configure test runner
|
# Configure test runner
|
||||||
- name: Run tests
|
- uses: webbertakken/unity-test-runner@v1.2
|
||||||
id: testRunner
|
id: testRunner
|
||||||
uses: webbertakken/unity-test-runner@v1
|
with:
|
||||||
env:
|
projectPath: test-project
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
testMode: editmode
|
||||||
UNITY_PROJECT_PATH: test-project
|
|
||||||
TEST_MODE: editmode
|
|
||||||
|
|
||||||
# Upload artifact
|
# Upload artifact
|
||||||
- name: Expose as artifact
|
- uses: actions/upload-artifact@v1
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
with:
|
||||||
name: Test results (edit mode)
|
name: Test results (edit mode)
|
||||||
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||||
@@ -148,8 +129,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository (required to test local actions)
|
# Checkout repository (required to test local actions)
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
@@ -163,17 +143,14 @@ jobs:
|
|||||||
Library-
|
Library-
|
||||||
|
|
||||||
# Configure test runner
|
# Configure test runner
|
||||||
- name: Run tests
|
- uses: webbertakken/unity-test-runner@v1.2
|
||||||
id: testRunner
|
id: testRunner
|
||||||
uses: webbertakken/unity-test-runner@v1
|
|
||||||
env:
|
env:
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
projectPath: test-project
|
||||||
UNITY_PROJECT_PATH: test-project
|
testMode: playmode
|
||||||
TEST_MODE: playmode
|
|
||||||
|
|
||||||
# Upload artifact
|
# Upload artifact
|
||||||
- name: Expose as artifact
|
- uses: actions/upload-artifact@v1
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
with:
|
||||||
name: Test results (play mode)
|
name: Test results (play mode)
|
||||||
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||||
@@ -183,8 +160,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository (required to test local actions)
|
# Checkout repository (required to test local actions)
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
@@ -198,22 +174,23 @@ jobs:
|
|||||||
Library-
|
Library-
|
||||||
|
|
||||||
# Configure test runner
|
# Configure test runner
|
||||||
- name: Run tests
|
- uses: webbertakken/unity-test-runner@v1.2
|
||||||
id: testRunner
|
id: testRunner
|
||||||
uses: webbertakken/unity-test-runner@v1
|
with:
|
||||||
env:
|
projectPath: test-project
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
testMode: all
|
||||||
UNITY_PROJECT_PATH: test-project
|
|
||||||
TEST_MODE: all
|
|
||||||
|
|
||||||
# Upload artifacts
|
# Upload artifacts
|
||||||
- name: Expose as artifact
|
- uses: actions/upload-artifact@v1
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
with:
|
||||||
name: Test results (all modes)
|
name: Test results (all modes)
|
||||||
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||||
|
|
||||||
buildForSomePlatforms:
|
#
|
||||||
|
# Complete advanced workflow
|
||||||
|
#
|
||||||
|
|
||||||
|
buildAndTestForSomePlatforms:
|
||||||
name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
|
name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -240,11 +217,21 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
Library-${{ matrix.projectPath }}-
|
Library-${{ matrix.projectPath }}-
|
||||||
Library-
|
Library-
|
||||||
|
- uses: webbertakken/unity-test-runner@v1.2
|
||||||
|
id: testRunner
|
||||||
|
with:
|
||||||
|
projectPath: ${{ matrix.projectPath }}
|
||||||
|
unityVersion: ${{ matrix.unityVersion }}
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: Test results (all modes)
|
||||||
|
path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||||
- uses: webbertakken/unity-builder@v0.9
|
- uses: webbertakken/unity-builder@v0.9
|
||||||
with:
|
with:
|
||||||
projectPath: ${{ matrix.projectPath }}
|
projectPath: ${{ matrix.projectPath }}
|
||||||
unityVersion: ${{ matrix.unityVersion }}
|
unityVersion: ${{ matrix.unityVersion }}
|
||||||
targetPlatform: ${{ matrix.targetPlatform }}
|
targetPlatform: ${{ matrix.targetPlatform }}
|
||||||
|
customParameters: "-myParameter myValue -myBoolean -ThirdParameter andItsValue
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: Build
|
name: Build
|
||||||
|
|||||||
Reference in New Issue
Block a user