feat: Provides motion to SDK avatars shapes when changing position (#… #12089
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 Test | |
on: | |
pull_request: | |
paths: | |
- 'Explorer/**' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
- labeled | |
merge_group: {} | |
push: { branches: [dev] } | |
env: | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
UNITY_LICENSE: ${{ secrets.UNITY_PERSONAL_LICENSE }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event.pull_request.draft == false) || (github.event.label.name == 'force-build') || (github.event.label.name == 'clean-build') | |
name: Test | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Create LFS file list | |
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | |
- name: Restore LFS cache | |
uses: actions/cache@v4 | |
id: lfs-cache | |
with: | |
path: .git/lfs | |
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} | |
- name: Git LFS Pull | |
run: | | |
git lfs pull | |
git add . | |
git reset --hard | |
- name: Restore Library cache | |
uses: actions/cache@v4 | |
with: | |
path: Explorer/Library | |
key: Library-Explorer-Windows | |
- name: Setup SSH Agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: 'Add GitHub to the SSH known hosts file' | |
run: | | |
$sshPath = Join-Path $env:USERPROFILE ".ssh" | |
if (-not (Test-Path $sshPath)) { | |
New-Item -ItemType Directory -Path $sshPath -Force | |
} | |
$knownHostsPath = Join-Path $sshPath "known_hosts" | |
$githubKeys = (Invoke-RestMethod -Uri 'https://api.github.com/meta').ssh_keys | |
$githubKeys | ForEach-Object { "github.com $_" } | Out-File -FilePath $knownHostsPath -Append | |
# Set permissions (600 in Windows terms) | |
$acl = Get-Acl $knownHostsPath | |
$acl.SetAccessRuleProtection($true, $false) | |
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($env:USERNAME, "Read, Write", "Allow") | |
$acl.AddAccessRule($rule) | |
Set-Acl $knownHostsPath $acl | |
- name: Clone Packages To Use Locally | |
run: | | |
git clone [email protected]:decentraland/unity-explorer-packages.git | |
$jsonFilePath = "Explorer/Packages/manifest.json" | |
(Get-Content $jsonFilePath) ` | |
-replace '[email protected]:decentraland/unity-explorer-packages.git\?path=/StylizedGrassShader', 'file:../../unity-explorer-packages/StylizedGrassShader' ` | |
-replace '[email protected]:decentraland/unity-explorer-packages.git\?path=/StylizedWater2', 'file:../../unity-explorer-packages/StylizedWater2' ` | |
-replace '[email protected]:decentraland/unity-explorer-packages.git\?path=/AVProVideo', 'file:../../unity-explorer-packages/AVProVideo' ` | |
-replace '[email protected]:decentraland/unity-explorer-packages.git\?path=/SuperScrollView', 'file:../../unity-explorer-packages/SuperScrollView' ` | |
-replace '[email protected]:decentraland/unity-explorer-packages.git\?path=/SoftMask', 'file:../../unity-explorer-packages/SoftMask' | | |
Set-Content $jsonFilePath | |
Get-ChildItem | |
Get-Content $jsonFilePath | |
# Configure test runner | |
- uses: game-ci/[email protected] | |
id: testRunner | |
timeout-minutes: 60 | |
continue-on-error: true | |
with: | |
projectPath: Explorer | |
testMode: all | |
- name: Convert NUnit to JUnit | |
if: always() | |
run: | | |
New-Item -ItemType Directory -Force -Path "${{ steps.testRunner.outputs.artifactsPath }}-junit" | |
choco install xsltproc | |
xsltproc ` | |
--output "${{ steps.testRunner.outputs.artifactsPath }}-junit/playmode-results-junit.xml" ` | |
.github/workflows/nunit-to-junit.xsl ` | |
"${{ steps.testRunner.outputs.artifactsPath }}/playmode-results.xml" | |
xsltproc ` | |
--output "${{ steps.testRunner.outputs.artifactsPath }}-junit/editmode-results-junit.xml" ` | |
.github/workflows/nunit-to-junit.xsl ` | |
"${{ steps.testRunner.outputs.artifactsPath }}/editmode-results.xml" | |
- name: Report test results | |
uses: decentraland/[email protected] | |
if: always() | |
with: | |
name: Report test results | |
path: ${{ steps.testRunner.outputs.artifactsPath }}-junit/*.xml | |
reporter: jest-junit | |
# Upload artifact | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: Test results (play mode & edit mode) | |
path: ${{ steps.testRunner.outputs.artifactsPath }} | |
if-no-files-found: error |