-
Notifications
You must be signed in to change notification settings - Fork 296
103 lines (99 loc) · 4.94 KB
/
testPackageOnWindows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Test Package On Windows
on:
workflow_call:
inputs:
runner-label:
required: true
type: string
visual-studio-version:
required: false
type: string
default: ''
visual-studio-components:
required: false
type: string
default: ''
unreal-engine-zip:
required: true
type: string
unreal-program-name:
required: true
type: string
unreal-engine-association:
required: true
type: string
test-package-base-name:
required: true
type: string
jobs:
test:
runs-on: ${{ inputs.runner-label }}
steps:
- name: Install Visual Studio components
if: ${{ inputs.visual-studio-version && inputs.visual-studio-components }}
run: |
$components = "${{ inputs.visual-studio-components }}" -split "," | foreach {"--add $_"}
if ($components.Length -gt 0)
{
$componentcmd = $components -join " "
Start-Process "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "modify --installPath ""C:\Program Files\Microsoft Visual Studio\${{ inputs.visual-studio-version }}\Enterprise"" --quiet $componentcmd" -Wait -PassThru
}
- name: Check out repository code
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
TestsProject
- name: Set environment variables
run: |
$env:CESIUM_UNREAL_VERSION=$env:GITHUB_REF_NAME
$env:PLUGIN_PACKAGE_NAME="${{ inputs.test-package-base-name }}-${env:CESIUM_UNREAL_VERSION}"
$env:TESTS_PROJECT_ROOT="$env:GITHUB_WORKSPACE/TestsProject"
# Use "cookonthefly" to skip cook step, "cook" to do cook (shader compile, very slow)
$env:UNREAL_COOK_PARAM="cookonthefly"
# Make these available to subsequent steps
echo "PLUGIN_PACKAGE_NAME=${env:PLUGIN_PACKAGE_NAME}" >> $env:GITHUB_ENV
echo "UNREAL_COOK_PARAM=${env:UNREAL_COOK_PARAM}" >> $env:GITHUB_ENV
echo "TESTS_PROJECT_ROOT=${env:TESTS_PROJECT_ROOT}" >> $env:GITHUB_ENV
# Confirm vars to the console
echo ""
echo PLUGIN_PACKAGE_NAME=$env:PLUGIN_PACKAGE_NAME
echo UNREAL_COOK_PARAM=$env:UNREAL_COOK_PARAM
echo TESTS_PROJECT_ROOT=$env:TESTS_PROJECT_ROOT
- name: Install Unreal Engine
uses: ./.github/actions/install-unreal-windows
with:
unreal-engine-zip: ${{ inputs.unreal-engine-zip }}
unreal-program-name: ${{ inputs.unreal-program-name }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Download plugin artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.PLUGIN_PACKAGE_NAME}}
path: download
- name: Install plugin to Unreal Engine
run: |
dir download/CesiumForUnreal
md "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Plugins/Marketplace"
cp "download/CesiumForUnreal" "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Plugins/Marketplace" -r
- name: Overwrite tests project engine association
run: |
((Get-Content -path "$env:TESTS_PROJECT_ROOT/TestsProject.uproject" -Raw) -replace '"EngineAssociation": "5.0"','"EngineAssociation": "${{ inputs.unreal-engine-association }}"') | Set-Content -Path "$env:TESTS_PROJECT_ROOT/TestsProject.uproject"
- name: Display tests engine association
run: |
cd download/CesiumForUnreal
dir
Get-Content "$env:TESTS_PROJECT_ROOT/TestsProject.uproject" | select-string -pattern "EngineAssociation"
- name: Display plugin engine version
run: |
cd download/CesiumForUnreal
dir
Get-Content "CesiumForUnreal.uplugin" | select-string -pattern "EngineVersion"
- name: Run packaging test
run: |
cd "D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Build/BatchFiles"
./RunUAT.bat -ScriptsForProject="$env:TESTS_PROJECT_ROOT/TestsProject.uproject" Turnkey -command=VerifySdk -platform=Win64 -UpdateIfNeeded -EditorIO -EditorIOPort=54342 -project="$env:TESTS_PROJECT_ROOT/TestsProject.uproject" BuildCookRun -nop4 -utf8output -nocompileeditor -skipbuildeditor -$env:UNREAL_COOK_PARAM -project="$env:TESTS_PROJECT_ROOT/TestsProject.uproject" -unrealexe="D:/Program Files/Epic Games/${{ inputs.unreal-program-name }}/Engine/Binaries/Win64/UnrealEditor-Cmd.exe" -platform=Win64 -ddc=InstalledDerivedDataBackendGraph -installed -stage -archive -package -build -compressed -iostore -pak -prereqs -archivedirectory="$env:GITHUB_WORKSPACE/TestPackaging" -nocompile
- name: Sanity check output
run: |
if (!(Test-Path "$env:GITHUB_WORKSPACE/TestPackaging/Windows/TestsProject.exe") ) { exit -1 }