Set LineProvider YarnProject on awake #328
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests 🧪 | |
env: | |
ACTIONS_RUNNER_DEBUG: true | |
ACTIONS_STEP_DEBUG: true | |
on: | |
push: | |
branches: | |
- main | |
- development/v3 | |
- "feature/**" | |
paths: | |
- "Editor/**" | |
- "Runtime/**" | |
- "Samples~/**" | |
- "Tests/**" | |
workflow_dispatch: | |
jobs: | |
buildAndTestForSomePlatforms: | |
concurrency: | |
group: ${{ github.workflow }}-${{ matrix.unityVersion }}-${{ matrix.unityLocalisation }} | |
cancel-in-progress: true # Cancel other jobs if another one arrives | |
name: ${{ matrix.unityVersion }} (${{ matrix.targetPlatform }}, ${{ matrix.unityLocalisation && 'with unity loc' || 'no unity loc' }}) | |
runs-on: [self-hosted, linux] | |
strategy: | |
fail-fast: false | |
# max-parallel: 1 # Only run one at a time, to prevent license contention | |
matrix: | |
projectPath: | |
- YarnSpinner | |
unityVersion: | |
# - 2022.3.21f1 | |
# - 2023.2.12f1 | |
- 6000.0.24f1 | |
unityLocalisation: | |
- true | |
- false | |
targetPlatform: | |
# - StandaloneOSX # Build a macOS standalone (Intel 64-bit). | |
# - StandaloneWindows64 # Build a Windows 64-bit standalone. | |
- StandaloneLinux64 # Build a Linux 64-bit standalone. | |
# - iOS # Build an iOS player. | |
# - Android # Build an Android player. | |
# - WebGL # WebGL. | |
steps: | |
- name: Create empty Unity project | |
run: | | |
mkdir -p ${{ matrix.projectPath }}/Assets | |
mkdir -p ${{ matrix.projectPath }}/ProjectSettings | |
mkdir -p ${{ matrix.projectPath }}/Packages | |
mkdir -p output | |
# Add the Unity Input System package, and configure the new project to use | |
# both the Input System and the legacy Input Manager. | |
- name: Add Input System package | |
run: | | |
cat <<EOF > ${{ matrix.projectPath }}/ProjectSettings/ProjectSettings.asset | |
%YAML 1.1 | |
%TAG !u! tag:unity3d.com,2011: | |
--- !u!129 &1 | |
PlayerSettings: | |
activeInputHandler: 2 | |
EOF | |
cat <<EOF > ${{ matrix.projectPath }}/Packages/manifest.json | |
{ | |
"dependencies": { | |
"com.unity.inputsystem": "1.11.2" | |
} | |
} | |
EOF | |
- name: Add Unity Localisation Package | |
if: ${{ matrix.unityLocalisation }} | |
run: | | |
jq '.dependencies += {"com.unity.localization": "1.3.2"}' ${{ matrix.projectPath }}/Packages/manifest.json > /tmp/manifest.json | |
mv /tmp/manifest.json ${{ matrix.projectPath }}/Packages/manifest.json | |
- name: Check out to Packages/YarnSpinner | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
path: ${{ matrix.projectPath }}/Packages/YarnSpinner | |
- name: Run edit mode tests | |
run: | | |
docker run \ | |
--rm \ | |
-v ./${{ matrix.projectPath }}:/project \ | |
-v ./output:/output \ | |
-e TEST_MODE=EditMode \ | |
--hostname YS-Linux-Build \ | |
yarnspinner/unity-${{ matrix.unityVersion }} | |
- name: Run play mode tests | |
if: always() | |
run: | | |
docker run \ | |
--rm \ | |
-v ./${{ matrix.projectPath }}:/project \ | |
-v ./output:/output \ | |
-e TEST_MODE=PlayMode \ | |
--hostname YS-Linux-Build \ | |
yarnspinner/unity-${{ matrix.unityVersion }} | |
- name: Generate HTML test report (Play Mode) | |
uses: rjtngit/nunit-html-action@v1 | |
if: always() | |
with: | |
inputXmlPath: output/TestResults-PlayMode.xml | |
outputHtmlPath: output/TestResults-PlayMode.html | |
- name: Generate HTML test report (Edit Mode) | |
uses: rjtngit/nunit-html-action@v1 | |
if: always() | |
with: | |
inputXmlPath: output/TestResults-EditMode.xml | |
outputHtmlPath: output/TestResults-EditMode.html | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: Test results (edit + play, ${{ matrix.unityVersion }} ${{ matrix.targetPlatform }} ${{ matrix.unityLocalisation && 'with-unity-loc' || 'no-unity-loc' }}) | |
# path: ${{ steps.testRunner.outputs.artifactsPath }} | |
path: ./output | |
- name: Upload edit mode test report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: Test Report (edit mode, ${{ matrix.unityVersion }} ${{ matrix.targetPlatform }} ${{ matrix.unityLocalisation && 'with-unity-loc' || 'no-unity-loc' }}) | |
path: ./output/TestResults-EditMode.html | |
- name: Upload play mode test report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: Test Report (play mode, ${{ matrix.unityVersion }} ${{ matrix.targetPlatform }} ${{ matrix.unityLocalisation && 'with-unity-loc' || 'no-unity-loc' }}) | |
path: ./output/TestResults-PlayMode.html |