Run Tests and Package SDK on commit 7dc796c66957472b59bf6deca1640cdb4b72924c #150
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: Run Tests and Package SDK | |
run-name: Run Tests and Package SDK on commit ${{ github.sha }} | |
on: | |
pull_request: | |
branches: # Made towards the following | |
- main | |
- dev* | |
types: # Only on the following activity | |
- opened | |
- synchronize # Changes to the branch like new commits, ammends, etc. | |
push: | |
branches: # Made towards the following | |
- main | |
tags: | |
- v** | |
workflow_dispatch: {} | |
jobs: | |
functional-tests: | |
name: Functional tests with config ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
matrix: | |
testMode: | |
- playmode | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.29f1 | |
- 2022.3.7f1 | |
jsonLibrary: | |
- zerodep | |
- newtonsoft | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v2 | |
- name: Checkout test repository | |
uses: actions/checkout@v2 | |
with: | |
repository: LootLocker/unity-sdk-tests | |
path: ./tests~ # Unity ignores folders with ~ from inclusion | |
- name: Set SDK path in test repo | |
run: sudo chmod 777 ./tests~/switchLootLockerDependency.sh && ./tests~/switchLootLockerDependency.sh "./tests~/" "file:../../" | |
- name: Cache Libraries | |
uses: actions/cache@v2 | |
with: | |
path: tests~/Library | |
key: Library-${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }} | |
restore-keys: Library- | |
- name: Configure LootLocker to use Newtonsoft JSON | |
if: ${{ matrix.jsonLibrary == 'newtonsoft' }} | |
run: | | |
sed -i 's/NO_LOOTLOCKER_USE_NEWTONSOFTJSON/LOOTLOCKER_USE_NEWTONSOFTJSON/' tests~/ProjectSettings/ProjectSettings.asset | |
- name: Run tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }} | |
uses: game-ci/unity-test-runner@v2 | |
id: tests | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
testMode: ${{ matrix.testMode }} | |
checkName: ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }} Test Results | |
artifactsPath: ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }}-artifacts | |
projectPath: tests~/ | |
unityVersion: ${{ matrix.unityVersion }} | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
customParameters: -apikey ${{ secrets.LOOTLOCKER_API_KEY }} -domainkey ${{ secrets.LOOTLOCKER_DOMAIN_KEY }} | |
editor-smoke-test: | |
name: Test SDK in Editor | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [] | |
timeout-minutes: 10 | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
testMode: | |
- playmode | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-smoketest-project | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Select stage keys | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.SMOKE_TEST_LL_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.SMOKE_TEST_LL_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Select prod keys | |
if: ${{ env.LL_USE_STAGE == 'false' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.LOOTLOCKER_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.LOOTLOCKER_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-smoketest-project repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-smoketest-project | |
path: unity-sdk-smoketest-project | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Set package reference to local unity-sdk | |
run: | | |
echo "Updating unity-sdk-smoketest-project/Packages/manifest.json to use lootlocker sdk at relative path (from manifest) ../../unity-sdk" | |
jq ".\"dependencies\".\"com.lootlocker.lootlockersdk\"=\"file:../../unity-sdk\"" "unity-sdk-smoketest-project/Packages/manifest.json" > "unity-sdk-smoketest-project/Packages/tempmanifest.json" | |
rm "unity-sdk-smoketest-project/Packages/manifest.json" | |
mv "unity-sdk-smoketest-project/Packages/tempmanifest.json" "unity-sdk-smoketest-project/Packages/manifest.json" | |
- name: Configure LootLocker to take keys by commandline | |
run: | | |
sed -i 's/NO_LOOTLOCKER_COMMANDLINE_SETTINGS/LOOTLOCKER_COMMANDLINE_SETTINGS/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- name: Configure LootLocker to target stage environment | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/NO_LOOTLOCKER_TARGET_STAGE_ENV/LOOTLOCKER_TARGET_STAGE_ENV/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-smoketest-project/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
Library- | |
- name: Run Smoke Tests ${{ matrix.unityVersion }}-${{ matrix.testMode }} | |
id: editor-smoke-tests-gameci | |
uses: game-ci/unity-test-runner@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
testMode: ${{ matrix.testMode }} | |
checkName: ${{ matrix.unityVersion }}-${{ matrix.testMode }} Test Results | |
artifactsPath: editor-smoke-tests-gameci-${{ matrix.unityVersion }}-${{ matrix.testMode }}-artifacts | |
projectPath: unity-sdk-smoketest-project | |
unityVersion: ${{ matrix.unityVersion }} | |
githubToken: ${{ SECRETS.GITHUB_TOKEN }} | |
customParameters: -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }} | |
linux-build-smoke-test: | |
name: Test SDK in StandaloneLinux64 build | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [] | |
timeout-minutes: 10 | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
testMode: | |
- playmode | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
targetPlatform: | |
- StandaloneLinux64 | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-smoketest-project | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Select stage keys | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.SMOKE_TEST_LL_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.SMOKE_TEST_LL_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Select prod keys | |
if: ${{ env.LL_USE_STAGE == 'false' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.LOOTLOCKER_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.LOOTLOCKER_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-smoketest-project repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-smoketest-project | |
path: unity-sdk-smoketest-project | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Set package reference to local unity-sdk | |
run: | | |
echo "Updating unity-sdk-smoketest-project/Packages/manifest.json to use lootlocker sdk at relative path (from manifest) ../../unity-sdk" | |
jq ".\"dependencies\".\"com.lootlocker.lootlockersdk\"=\"file:../../unity-sdk\"" "unity-sdk-smoketest-project/Packages/manifest.json" > "unity-sdk-smoketest-project/Packages/tempmanifest.json" | |
rm "unity-sdk-smoketest-project/Packages/manifest.json" | |
mv "unity-sdk-smoketest-project/Packages/tempmanifest.json" "unity-sdk-smoketest-project/Packages/manifest.json" | |
- name: Configure LootLocker to take keys by commandline | |
run: | | |
sed -i 's/NO_LOOTLOCKER_COMMANDLINE_SETTINGS/LOOTLOCKER_COMMANDLINE_SETTINGS/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- name: Configure LootLocker to target stage environment | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/NO_LOOTLOCKER_TARGET_STAGE_ENV/LOOTLOCKER_TARGET_STAGE_ENV/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- name: Commit all changes to allow building | |
run: | | |
git config --global user.email "fake@email.com" | |
git config --global user.name "Fake Name" | |
cd unity-sdk-smoketest-project | |
git add -A | |
git commit -m "Temporary changes for build" | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-smoketest-project/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
Library- | |
- name: Run Smoke Tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.targetPlatform }} | |
id: build-smoke-tests-gameci | |
uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
unityVersion: ${{ matrix.unityVersion }} | |
targetPlatform: ${{ matrix.targetPlatform }} | |
buildsPath: builds | |
buildName: smokeTest | |
projectPath: unity-sdk-smoketest-project | |
customParameters: -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }} | |
- name: Run the built game | |
run: | | |
sudo chmod 777 ./builds | |
sudo chmod 777 ./builds/${{ matrix.targetPlatform }}/ | |
sudo chmod 777 ./builds/${{ matrix.targetPlatform }}/* | |
./builds/${{ matrix.targetPlatform }}/smokeTest -batchmode -nographics -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }} | |
while [ ! -f "./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt" ]; do sleep 10; ls -als ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/; done | |
- name: Test the output of the run | |
run: | | |
cat ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt | |
grep -q "Run Succeeded" ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt | |
exit $? | |
webgl-build-smoke-test: | |
name: Test SDK in WebGL build | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [] | |
timeout-minutes: 20 | |
if: (startsWith(github.ref, 'refs/pull') && endsWith(github.base_ref, 'main')) || startsWith(github.ref, 'refs/tags/v') || (startsWith(github.ref, 'refs/heads') && endsWith(github.ref, 'main')) | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
testMode: | |
- playmode | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
targetPlatform: | |
- WebGL | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-smoketest-project | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Select stage keys | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.SMOKE_TEST_LL_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.SMOKE_TEST_LL_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Select prod keys | |
if: ${{ env.LL_USE_STAGE == 'false' }} | |
run: | | |
echo "JOB_API_KEY=${{ SECRETS.LOOTLOCKER_API_KEY }}" >> $GITHUB_ENV | |
echo "JOB_DOMAIN_KEY=${{ SECRETS.LOOTLOCKER_DOMAIN_KEY }}" >> $GITHUB_ENV | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-smoketest-project repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-smoketest-project | |
path: unity-sdk-smoketest-project | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Set package reference to local unity-sdk | |
run: | | |
echo "Updating unity-sdk-smoketest-project/Packages/manifest.json to use lootlocker sdk at relative path (from manifest) ../../unity-sdk" | |
jq ".\"dependencies\".\"com.lootlocker.lootlockersdk\"=\"file:../../unity-sdk\"" "unity-sdk-smoketest-project/Packages/manifest.json" > "unity-sdk-smoketest-project/Packages/tempmanifest.json" | |
rm "unity-sdk-smoketest-project/Packages/manifest.json" | |
mv "unity-sdk-smoketest-project/Packages/tempmanifest.json" "unity-sdk-smoketest-project/Packages/manifest.json" | |
- name: Configure LootLocker to take keys by commandline | |
run: | | |
sed -i 's/NO_LOOTLOCKER_COMMANDLINE_SETTINGS/LOOTLOCKER_COMMANDLINE_SETTINGS/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- name: Configure LootLocker to target stage environment | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
sed -i 's/NO_LOOTLOCKER_TARGET_STAGE_ENV/LOOTLOCKER_TARGET_STAGE_ENV/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset | |
- name: Commit all changes to allow building | |
run: | | |
git config --global user.email "fake@email.com" | |
git config --global user.name "Fake Name" | |
cd unity-sdk-smoketest-project | |
git add -A | |
git commit -m "Temporary changes for build" | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-smoketest-project/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project | |
Library- | |
- name: Run Smoke Tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.targetPlatform }} | |
id: build-smoke-tests-gameci | |
uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
unityVersion: ${{ matrix.unityVersion }} | |
targetPlatform: ${{ matrix.targetPlatform }} | |
buildsPath: builds | |
buildName: smokeTest | |
projectPath: unity-sdk-smoketest-project | |
customParameters: -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }} | |
test-samples: | |
name: Test Samples | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [editor-smoke-test, linux-build-smoke-test] | |
timeout-minutes: 8 | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-packager | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-sample-tester repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-sample-tester | |
path: unity-sdk-sample-tester | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Add LootLockerSDK as asset folder | |
run: | | |
cp -r unity-sdk unity-sdk-sample-tester/Assets/LootLockerSDK | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-sample-tester/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-sample-tester | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-sample-tester | |
Library- | |
- name: Compile and run all sample scenes ${{ matrix.unityVersion }} | |
id: test-samples | |
uses: game-ci/unity-test-runner@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
testMode: editmode | |
checkName: Sample Scene ${{ matrix.unityVersion }} Test Results | |
artifactsPath: test-samples-${{ matrix.unityVersion }}-artifacts | |
projectPath: unity-sdk-sample-tester | |
unityVersion: ${{ matrix.unityVersion }} | |
githubToken: ${{ SECRETS.GITHUB_TOKEN }} | |
validate-sdk: | |
name: Validate SDK | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [editor-smoke-test, linux-build-smoke-test] | |
timeout-minutes: 8 | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-packager | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-package-validator repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-package-validator | |
path: unity-sdk-package-validator | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Add LootLockerSDK as asset folder | |
run: | | |
cp -r unity-sdk unity-sdk-package-validator/Assets/LootLockerSDK | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-package-validator/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-package-validator | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-package-validator | |
Library- | |
- name: Validate SDK using asset store tools | |
id: validate-sdk | |
uses: game-ci/unity-test-runner@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
testMode: editmode | |
checkName: Validate SDK ${{ matrix.unityVersion }} Test Results | |
artifactsPath: validate-sdk-${{ matrix.unityVersion }}-artifacts | |
projectPath: unity-sdk-package-validator | |
unityVersion: ${{ matrix.unityVersion }} | |
githubToken: ${{ SECRETS.GITHUB_TOKEN }} | |
package-sdk: | |
name: Package SDK | |
runs-on: [ubuntu-latest] | |
#runs-on: [k8s] | |
#container: | |
# image: ubuntu-latest | |
needs: [test-samples, validate-sdk, functional-tests] | |
timeout-minutes: 5 | |
if: (startsWith(github.ref, 'refs/pull') && endsWith(github.base_ref, 'main')) || (startsWith(github.ref, 'refs/heads') && endsWith(github.ref, 'main')) || startsWith(github.ref, 'refs/tags/v') | |
env: | |
LL_USE_STAGE: false | |
strategy: | |
fail-fast: false | |
matrix: | |
unityVersion: | |
- 2019.4.40f1 | |
- 2020.3.48f1 | |
- 2021.3.32f1 | |
- 2022.3.14f1 | |
- 2023.2.1f1 | |
steps: | |
- name: Setup commandline dependencies (if on self-hosted runner) | |
if: ${{ env.LL_USE_STAGE == 'true' }} | |
run: | | |
apt update | |
apt-get install -y git | |
git config --global --add safe.directory unity-sdk | |
git config --global --add safe.directory unity-sdk-packager | |
apt-get install -y jq | |
apt-get install -y sed | |
apt-get install -y docker | |
apt-get install -y curl | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Checkout unity-sdk repository | |
uses: actions/checkout@v3 | |
with: | |
path: unity-sdk | |
- name: Checkout unity-sdk-packager-project repository | |
uses: actions/checkout@v3 | |
with: | |
repository: lootlocker/unity-sdk-packager | |
path: unity-sdk-packager | |
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }} | |
- name: Add LootLockerSDK as asset folder | |
run: | | |
cp -r unity-sdk unity-sdk-packager/Assets/LootLockerSDK | |
- uses: actions/cache@v3 | |
with: | |
path: unity-sdk-packager/Library | |
key: ${{ matrix.targetPlatform }}-Library-unity-sdk-packager | |
restore-keys: | | |
${{ matrix.targetPlatform }}-Library-unity-sdk-packager | |
Library- | |
- name: Package SDK for ${{ matrix.unityVersion }} | |
id: package-sdk-gameci | |
uses: game-ci/unity-test-runner@v4 | |
env: | |
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }} | |
with: | |
testMode: editmode | |
checkName: SDK Packaging ${{ matrix.unityVersion }} Test Results | |
artifactsPath: package-sdk-${{ matrix.unityVersion }}-artifacts | |
projectPath: unity-sdk-packager | |
unityVersion: ${{ matrix.unityVersion }} | |
githubToken: ${{ SECRETS.GITHUB_TOKEN }} | |
- name: Expose packaged SDK as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: LootLockerSDK-${{ matrix.unityVersion }}.zip | |
path: unity-sdk-packager/LootLockerSDK*.unitypackage |