fix: main stage LOD #408
Workflow file for this run
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: Test LOD Conversion | |
on: | |
pull_request: | |
types: [edited, opened, reopened, synchronize] | |
jobs: | |
build-and-run: | |
runs-on: windows-2019 | |
env: | |
COORDS: "-55,1" # Define coordinates as an environment variable | |
strategy: | |
matrix: | |
include: | |
- lodLevelsToTest: ["500", "3"] | |
files: "QmTpsFiaJVPv5mU6ERBzkDcZ39Lyq9sEfiLw9Ep3VQAFgK_3.fbx" | |
sizes: "1613824" | |
- lodLevelsToTest: ["7000;3000;1000;500", "0"] | |
files: "QmTpsFiaJVPv5mU6ERBzkDcZ39Lyq9sEfiLw9Ep3VQAFgK_0.fbx QmTpsFiaJVPv5mU6ERBzkDcZ39Lyq9sEfiLw9Ep3VQAFgK_1.fbx QmTpsFiaJVPv5mU6ERBzkDcZ39Lyq9sEfiLw9Ep3VQAFgK_2.fbx QmTpsFiaJVPv5mU6ERBzkDcZ39Lyq9sEfiLw9Ep3VQAFgK_3.fbx" | |
sizes: "48934912 3428352 2424832 1613824" | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Checkout NuGet PiXYZ package | |
uses: actions/checkout@v2 | |
with: | |
repository: 'decentraland/PiXYZ-NuGetPackage' | |
token: ${{ secrets.PAT_NUGET_TOKEN }} | |
path: 'PiXYZ-NuGetPackage' | |
lfs: true | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Publish with dotnet | |
run: dotnet publish -c Release -r win10-x64 -o ./publish --self-contained true | |
- name: Copy manifest builder to publish directory | |
run: | | |
Copy-Item -Path "${{ github.workspace }}\DCL_PiXYZ\bin\Release\netcoreapp3.1\win10-x64\scene-lod-entities-manifest-builder" -Destination "${{ github.workspace }}\publish\scene-lod-entities-manifest-builder" -Recurse | |
shell: pwsh | |
- name: Copy road coordinates | |
run: | | |
Copy-Item -Path "${{ github.workspace }}\DCL_PiXYZ\bin\Release\netcoreapp3.1\win10-x64\SingleParcelRoadCoordinates.json" -Destination "${{ github.workspace }}\publish" | |
shell: pwsh | |
- name: Copy license file | |
run: | | |
Copy-Item -Path "${{ github.workspace }}\DCL_PiXYZ\bin\Release\netcoreapp3.1\win10-x64\pixyz_license_decentraland.bin" -Destination "${{ github.workspace }}\publish" | |
shell: pwsh | |
- name: Install Vulkan SDK | |
uses: jakoch/[email protected] | |
with: | |
vulkan_version: 1.3.268.0 | |
optional_components: com.lunarg.vulkan.vma | |
install_runtime: true | |
cache: true | |
destination: ${{ github.workspace }}/vulkan-sdt | |
- name: Move Vulkan DLL to output directory | |
run: | | |
mv ./vulkan-sdt/1.3.268.0/runtime/x64/vulkan-1.dll ./publish/ | |
shell: bash | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.14.2' | |
- name: Run the application | |
env: | |
PIXYZPRODUCTNAME: ${{ secrets.PIXYZPRODUCTNAME }} | |
PIXYZTOKEN: ${{ secrets.PIXYZTOKEN }} | |
run: .\publish\DCL_PiXYZ.exe --sceneToConvert "${{ env.COORDS }}" --defaultOutputPath "${{ github.workspace }}\publish\OutputDirectoryPath" --defaultSceneLodManifestDirectory "${{ github.workspace }}\publish\scene-lod-entities-manifest-builder" --debugMode false --installNPM true --decimationValues "${{ matrix.lodLevelsToTest[0] }}" --startingLODLevel ${{ matrix.lodLevelsToTest[1] }} | |
- name: Check Output Files with Size Tolerance in KB | |
run: | | |
basePath="${GITHUB_WORKSPACE}/publish/OutputDirectoryPath/${{ env.COORDS }}" | |
files=(${{ join(matrix.files, ' ') }}) | |
sizes=(${{ join(matrix.sizes, ' ') }}) | |
toleranceB=20000 # 10 KB tolerance | |
for i in "${!files[@]}"; do | |
filePath="$basePath/${files[$i]}" | |
if [ ! -f "$filePath" ]; then | |
echo "File not found: $filePath" | |
exit 1 | |
fi | |
fileSizeInBytes=$(stat -c %s "$filePath") | |
lowerBoundB=$((${sizes[$i]} - toleranceB)) | |
upperBoundB=$((${sizes[$i]} + toleranceB)) | |
if [ "$fileSizeInBytes" -lt "$lowerBoundB" ] || [ "$fileSizeInBytes" -gt "$upperBoundB" ]; then | |
echo "File size mismatch for $filePath. Expected: ${sizes[$i]} B (+/- $toleranceB B), Found: $fileSizeInBytes bytes" | |
exit 1 | |
fi | |
done | |
echo "All files exist and are within the acceptable size range." | |
shell: bash |