chore: change to 2.5.0-beta.3 #630
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: Unity Tests | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "**/*.cs" | |
- ".github/unity-project/**/*" | |
- ".github/workflows/unity-tests.yml" | |
pull_request: | |
paths: | |
- "**/*.cs" | |
- ".github/unity-project/**/*" | |
- ".github/workflows/unity-tests.yml" | |
jobs: | |
build: | |
name: Build and Test (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
unity-version: ['2019.4.31f1', '2022.3.6f1', '2023.2.2f1'] | |
import-vrcsdk: [false, true] | |
import-dynbone: [false, true] | |
exclude: | |
- unity-version: "2023.2.2f1" | |
import-vrcsdk: true | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET 6 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Prepare Unity Project | |
run: | | |
mv Tests~ Tests | |
mkdir -p .github/unity-project/Packages/com.chocopoi.vrc.dressingtools | |
mv [!.github]* .github/unity-project/Packages/com.chocopoi.vrc.dressingtools/ | |
mv .github/unity-project/* . | |
rm -rf .github/unity-project | |
ls -l | |
ls -l Packages/com.chocopoi.vrc.dressingtools | |
# Cache | |
- uses: actions/cache@v3 | |
with: | |
path: Library | |
key: Library-${{ matrix.unity-version }}-${{ matrix.import-vrcsdk }}-${{ matrix.import-dynbone }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
restore-keys: | | |
Library-${{ matrix.unity-version }}-${{ matrix.import-vrcsdk }}-${{ matrix.import-dynbone }}- | |
- name: Pre-clone Git Dependencies | |
run: | | |
git clone https://github.com/poi-vrc/AvatarLib.git Packages/com.chocopoi.vrc.avatarlib | |
git clone https://github.com/poi-vrc/DressingFramework.git Packages/com.chocopoi.vrc.dressingframework | |
- name: Resolve VPM Project | |
if: matrix.import-vrcsdk | |
run: | | |
mv Packages/vpm-manifest.${{ matrix.unity-version }}.json Packages/vpm-manifest.json | |
dotnet tool install --global vrchat.vpm.cli | |
vpm add repo https://vpm.chocopoi.com/index.json | |
vpm resolve project | |
# DynamicsBones stub | |
- name: Import DynamicBones stub | |
if: matrix.import-dynbone | |
run: | | |
wget -O Dynamic-Bones-Stub-main.zip https://github.com/VRLabs/Dynamic-Bones-Stub/archive/refs/heads/main.zip | |
unzip Dynamic-Bones-Stub-main.zip | |
ls -l Dynamic-Bones-Stub-main | |
cp -rfv Dynamic-Bones-Stub-main/Scripts Assets/Scripts | |
# Test | |
- name: Run tests | |
uses: game-ci/unity-test-runner@v4 | |
id: tests | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
unityVersion: ${{ matrix.unity-version }} | |
# we have too many tests, exceeded the github limit | |
# https://github.com/game-ci/unity-test-runner/issues/142 | |
# githubToken: ${{ secrets.GITHUB_TOKEN }} | |
testMode: 'all' | |
customParameters: '-assemblyNames "com.chocopoi.vrc.dressingtools.Editor.Tests;com.chocopoi.vrc.dressingtools.Runtime.Tests" -nographics' | |
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+com.chocopoi.vrc.dressingtools.Editor,+com.chocopoi.vrc.dressingtools.Runtime' | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: Test results (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}) | |
path: artifacts | |
# Upload coverage report to GitHub | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: Coverage results (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}) | |
path: ${{ steps.tests.outputs.coveragePath }} | |
# Upload coverage report to Codecov | |
- name: Upload XML report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: automated | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{ steps.tests.outputs.coveragePath }}/**/*.xml |