Skip to content

Remove unstable build world hook #168

Remove unstable build world hook

Remove unstable build world hook #168

Workflow file for this run

name: Run Tests
on:
workflow_dispatch:
push:
paths-ignore:
- '.docfx/**'
- '*.md'
- '.gitignore'
pull_request_target:
paths-ignore:
- '.docfx/**'
- '*.md'
- '.gitignore'
env:
PROJECT_PATH: .
PACKAGE_PATH: ./Packages/${{ github.event.repository.name }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
jobs:
test:
name: Test in ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
permissions:
checks: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 6000.0.51f1
- 6000.1.8f1
testMode:
- playmode
- standalone
vpmPackages:
- []
include:
- unityVersion: 2022.3.22f1
testMode: editmode
vpmPackages:
- com.vrchat.base
- nadena.dev.ndmf
- unityVersion: 2022.3.22f1
testMode: editmode
vpmPackages:
- nadena.dev.modular-avatar
steps:
- name: Create package testing project
uses: RamType0/[email protected]
with:
projectPath: ${{ env.PROJECT_PATH }}
unityVersion: ${{ matrix.unityVersion }}
# com.vrchat.base is missing dependency to com.unity.modules.video
# com.unity.xr.oculus (Referenced by com.vrchat.base) is missing dependency to com.unity.modules.androidjni
# Until https://github.com/bdunderscore/ndmf/pull/655 is merged into stable version, we need to define com.unity.modules.animation dependency explicitly.
manifest: |
{
"dependencies": {
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.testtools.codecoverage": "1.2.6"
}
}
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.PACKAGE_PATH }}
submodules: recursive
- name: Setup vrc-get
uses: anatawa12/sh-actions/setup-vrc-get@master
- name: Add VPM repositories
run: vrc-get repo add https://ramtype0.github.io/VpmRepository/index.json
- name: Install VPM packages
working-directory: ${{ env.PROJECT_PATH }}
run: |
printf '%s\n' "$VPM_PACKAGES" | while IFS= read -r package; do
if [ -n "${package:-}" ]; then
echo "installing $package" >&2
vrc-get install -y "$package"
fi
done
shell: bash
env:
VPM_PACKAGES: ${{ join(matrix.vpmPackages, fromJSON('"\n"')) }}
- name: Resolve VPM packages
run: vrc-get resolve
- name: Create LFS file list
working-directory: ${{ env.PACKAGE_PATH }}
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v3
with:
path: ${{ env.PACKAGE_PATH }}/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('./.lfs-assets-id') }}
- name: Git LFS Pull
working-directory: ${{ env.PACKAGE_PATH }}
run: |
git lfs pull
git add .
git reset --hard
- uses: actions/cache@v3
with:
path: ${{ env.PROJECT_PATH }}/Library
key: Library-${{ hashFiles('${{ env.PROJECT_PATH }}/Assets/**', '${{ env.PROJECT_PATH }}/Packages/**', '${{ env.PROJECT_PATH }}/ProjectSettings/**') }}
restore-keys: |
Library-
- uses: game-ci/unity-test-runner@v4
with:
unityVersion: ${{ matrix.unityVersion }}
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.testMode }}-artifacts
githubToken: ${{ github.token }}
checkName: ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+Meshia.MeshSimplification.*'
projectPath: ${{ env.PROJECT_PATH }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results for ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
path: ${{ env.PROJECT_PATH }}/${{ steps.tests.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results for ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
path: ${{ env.PROJECT_PATH }}/${{ steps.tests.outputs.coveragePath }}