同步
This commit is contained in:
102
Packages/dev.yarnspinner.unity/.github/workflows/broad_version_test.yml
vendored
Normal file
102
Packages/dev.yarnspinner.unity/.github/workflows/broad_version_test.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
name: Run Tests on Broad Version Range 🌶
|
||||
|
||||
env:
|
||||
ACTIONS_RUNNER_DEBUG: true
|
||||
ACTIONS_STEP_DEBUG: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
buildAndTestForSomePlatforms:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true # Cancel other jobs if another one arrives
|
||||
name: Test on ${{ matrix.unityVersion }} for ${{ matrix.targetPlatform }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 1 # Only run one at a time, to prevent license contention
|
||||
matrix:
|
||||
projectPath:
|
||||
- YarnSpinner
|
||||
unityVersion:
|
||||
- 2021.3.0f1
|
||||
- 2021.3.32f1
|
||||
- 2022.1.0f1
|
||||
- 2022.1.24f1
|
||||
- 2022.2.0f1
|
||||
- 2022.2.21f1
|
||||
- 2022.3.0f1
|
||||
- 2022.3.13f1
|
||||
- 2023.1.0f1
|
||||
- 2023.1.20f1
|
||||
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
|
||||
|
||||
# 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.0.2"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
- name: Check out to Packages/YarnSpinner
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
path: ${{ matrix.projectPath }}/Packages/YarnSpinner
|
||||
|
||||
- name: Fetch from Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ matrix.projectPath }}/Library
|
||||
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-${{ hashFiles(matrix.projectPath) }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-
|
||||
|
||||
- name: Run tests
|
||||
uses: game-ci/unity-test-runner@v4
|
||||
id: testRunner
|
||||
env:
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
checkName: 'Test Results ${{ matrix.unityVersion }}-${{ matrix.targetPlatform }}'
|
||||
# customParameters: -quit
|
||||
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: Test results (edit + play, ${{ matrix.unityVersion }}-${{ matrix.targetPlatform }}
|
||||
# path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||
path: artifacts
|
||||
37
Packages/dev.yarnspinner.unity/.github/workflows/release.yml
vendored
Normal file
37
Packages/dev.yarnspinner.unity/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Create Release 📦
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*.*.*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Extract release notes
|
||||
id: extract-release-notes
|
||||
uses: ffurrer2/extract-release-notes@v1
|
||||
- name: Read release notes preface
|
||||
id: release_preface
|
||||
uses: bluwy/substitute-string-action@v1
|
||||
with:
|
||||
_input-file: .github/RELEASE_TEMPLATE.md
|
||||
_format-key: '{key}'
|
||||
RELEASE_TAG: ${{ github.ref_name }}
|
||||
- name: Create release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
draft: true
|
||||
prerelease: true
|
||||
body: |
|
||||
${{ steps.release_preface.outputs.result }}
|
||||
${{ steps.extract-release-notes.outputs.release_notes }}
|
||||
|
||||
157
Packages/dev.yarnspinner.unity/.github/workflows/test.yml
vendored
Normal file
157
Packages/dev.yarnspinner.unity/.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
name: Run Tests 🧪
|
||||
|
||||
env:
|
||||
ACTIONS_RUNNER_DEBUG: true
|
||||
ACTIONS_STEP_DEBUG: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "feature/**"
|
||||
- "release/**"
|
||||
paths:
|
||||
- "Editor/**"
|
||||
- "Runtime/**"
|
||||
- "Samples~/**"
|
||||
- "Tests/**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
buildAndTestForSomePlatforms:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ matrix.unityVersion }}-${{ matrix.unityLocalisation }}-${{ matrix.uniTask }}
|
||||
cancel-in-progress: true # Cancel other jobs if another one arrives
|
||||
name: ${{ matrix.unityVersion }} (${{ matrix.targetPlatform }}, ${{ matrix.unityLocalisation && 'with unity loc' || 'no unity loc' }}, ${{ matrix.uniTask && 'with unitask' || 'no unitask' }})
|
||||
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.45f1
|
||||
- 2023.2.12f1
|
||||
- 6000.0.54f1
|
||||
- 6000.1.10f1
|
||||
unityLocalisation:
|
||||
- true
|
||||
- false
|
||||
uniTask:
|
||||
- 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
|
||||
shell: bash
|
||||
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
|
||||
shell: bash
|
||||
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
|
||||
|
||||
# Select correct TMP Essentials package
|
||||
if [[ ${{matrix.unityVersion}} == "2022"* ]]; then
|
||||
TMP_VERSION="ugui-1.0.0"
|
||||
else
|
||||
TMP_VERSION="ugui-2.0.0"
|
||||
fi
|
||||
echo "Installing TMP Essentials for $TMP_VERSION"
|
||||
|
||||
# Add the correct version of the TMP Essentials package to package manifest
|
||||
MANIFEST_PATH=${{ matrix.projectPath }}/Packages/manifest.json
|
||||
jq ".dependencies += {\"dev.yarnspinner.tmp-essentials\": \"https://github.com/desplesda/dev.yarnspinner.tmp-essentials.git#$TMP_VERSION\"}" "$MANIFEST_PATH" > manifest.json
|
||||
mv manifest.json "$MANIFEST_PATH"
|
||||
|
||||
- name: Add Unity Localisation
|
||||
if: ${{ matrix.unityLocalisation }}
|
||||
run: |
|
||||
# Add Unity Localisation package to package manifest
|
||||
MANIFEST_PATH=${{ matrix.projectPath }}/Packages/manifest.json
|
||||
jq '.dependencies += {"com.unity.localization": "1.3.2"}' "$MANIFEST_PATH" > manifest.json
|
||||
mv manifest.json "$MANIFEST_PATH"
|
||||
|
||||
- name: Add UniTask Package
|
||||
if: ${{ matrix.uniTask }}
|
||||
run: |
|
||||
# Add UniTask package to package manifest
|
||||
MANIFEST_PATH=${{ matrix.projectPath }}/Packages/manifest.json
|
||||
jq '.dependencies += {"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask"}' "$MANIFEST_PATH" > manifest.json
|
||||
mv manifest.json "$MANIFEST_PATH"
|
||||
|
||||
- name: Check out to Packages/YarnSpinner
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
path: ${{ matrix.projectPath }}/Packages/dev.yarnspinner.unity
|
||||
|
||||
- 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' }} ${{ matrix.uniTask && 'with-unitask' || 'no-unitask' }})
|
||||
# path: ${{ steps.testRunner.outputs.artifactsPath }}
|
||||
path: ./output
|
||||
98
Packages/dev.yarnspinner.unity/.github/workflows/update_dlls.yml
vendored
Normal file
98
Packages/dev.yarnspinner.unity/.github/workflows/update_dlls.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
name: Update DLLs 📚
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_dlls:
|
||||
name: Update Yarn Spinner DLLs
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# We need to be able to:
|
||||
# 1. create a branch in a repo ('contents'), and
|
||||
# 2. create a pull request using that branch ('pull-requests')
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Yarn Spinner for Unity
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: YarnSpinner-Unity
|
||||
- name: Checkout Yarn Spinner
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: YarnSpinnerTool/YarnSpinner
|
||||
path: YarnSpinner
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
9.0.x
|
||||
|
||||
- name: Fetch all commits
|
||||
run: git fetch --unshallow
|
||||
working-directory: ./YarnSpinner
|
||||
|
||||
- name: Install dotnet-assembly-alias
|
||||
run: dotnet tool install -g Alias
|
||||
|
||||
# Update the assembly info for this build of YS, so that the About window is
|
||||
# appropriate
|
||||
- name: Execute GitVersion
|
||||
id: version # step id used as reference for output values
|
||||
run: ./get-version.sh
|
||||
working-directory: ./YarnSpinner
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
working-directory: ./YarnSpinner
|
||||
|
||||
- name: Build
|
||||
run: dotnet build --no-restore --configuration Release
|
||||
working-directory: ./YarnSpinner
|
||||
|
||||
# Don't proceed unless we're including a build of Yarn Spinner that passes
|
||||
# its tests.
|
||||
- name: Test
|
||||
run: dotnet test --no-build --configuration Release --verbosity normal
|
||||
working-directory: ./YarnSpinner
|
||||
|
||||
# We need to copy dependency DLLs into the project, but if a Unity project
|
||||
# contains multiple DLLs with the same name (even from a package), that's an
|
||||
# error. This causes problems for users who want to use, for example,
|
||||
# Google.Protobuf (especially if they want to use a different version).
|
||||
#
|
||||
# Our solution partly involves renaming the dependency DLLs to have the
|
||||
# prefix 'Yarn.', and updating all references to these renamed DLLs, using
|
||||
# dotnet-assembly-alias
|
||||
# (https://github.com/getsentry/dotnet-assembly-alias/). For more
|
||||
# information on this fix, see
|
||||
# https://github.com/YarnSpinnerTool/YarnSpinner-Unity/issues/15#issuecomment-1036162152.
|
||||
- name: Rename vendored DLLs
|
||||
run: |
|
||||
assemblyalias --target-directory "YarnSpinner/YarnSpinner.Compiler/bin/Release/netstandard2.0/" --prefix "Yarn." --assemblies-to-alias "Antlr*;Csv*;Google*;"
|
||||
assemblyalias --target-directory "YarnSpinner/YarnSpinner.Compiler/bin/Release/netstandard2.0/" --internalize --prefix "Yarn." --assemblies-to-alias "System*;Microsoft.Bcl*;Microsoft.Extensions*"
|
||||
|
||||
# Copy all of the dependency DLLs into the YarnSpinner-Unity repo, except
|
||||
# for Microsoft.CSharp.dll (which is provided by Unity, so including it
|
||||
# would cause an error.)
|
||||
- name: Copy DLLs
|
||||
run: |
|
||||
cp -v YarnSpinner/YarnSpinner.Compiler/bin/Release/netstandard2.0/*.dll YarnSpinner-Unity/Runtime/DLLs
|
||||
cp -v YarnSpinner/YarnSpinner.Compiler/bin/Release/netstandard2.0/*.pdb YarnSpinner-Unity/Runtime/DLLs
|
||||
cp -v YarnSpinner/YarnSpinner.Compiler/bin/Release/netstandard2.0/*.xml YarnSpinner-Unity/Runtime/DLLs
|
||||
rm -fv YarnSpinner-Unity/Runtime/DLLs/Microsoft.CSharp.dll
|
||||
|
||||
# Make the PR against YarnSpinner-Unity that merges this change
|
||||
- name: Create pull request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
path: ./YarnSpinner-Unity
|
||||
commit-message: Update Yarn Spinner DLLs to YarnSpinnerTool/YarnSpinner@${{ steps.version.outputs.ShortSha }}
|
||||
branch: update-dlls-${{ steps.version.outputs.ShortSha }}
|
||||
title: Update Yarn Spinner DLLs to latest (${{ steps.version.outputs.ShortSha }})
|
||||
body: |
|
||||
This is an automated PR made by @${{ github.actor }} that updates the precompiled Yarn Spinner DLLs (and their dependencies) to YarnSpinnerTool/YarnSpinner@${{ steps.version.outputs.ShortSha }} (v${{ steps.version.outputs.SemVer }}).
|
||||
Reference in New Issue
Block a user