Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create main.yml #41

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Unity Actions

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: {}

### Refer to https://game.ci/docs/github/getting-started
jobs:
checklicense:
name: Check for UNITY_LICENSE in GitHub Secrets
runs-on: ubuntu-latest
outputs:
is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }}
steps:
- name: Check whether unity activation requests should be done
id: checklicense_job
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}"
export is_unity_license_set="${{ env.UNITY_LICENSE != '' }}"
echo "is_unity_license_set=$is_unity_license_set" >> $GITHUB_OUTPUT

activation:
needs: checklicense
if: needs.checklicense.outputs.is_unity_license_set == 'false'
name: Request manual activation file 🔑
runs-on: ubuntu-latest
steps:
# Request manual activation file
- name: Request manual activation file
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}

test:
needs: checklicense
if: needs.checklicense.outputs.is_unity_license_set == 'true'
name: Run all tests ✨
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-test
- uses: game-ci/unity-test-runner@v4
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
name: Test results (all modes)
path: ${{ steps.testRunner.outputs.artifactsPath }}


build:
needs: test
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneLinux64
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build

buildForMac:
needs: build
name: Build for ${{ matrix.targetPlatform }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneOSX
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build

buildForWindows:
needs: buildForMac
name: Build for ${{ matrix.targetPlatform }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows
- StandaloneWindows64
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ maes-ros-slam-ws/.idea
# Misc
/.vscode
/.vsconfig
ProjectSettings/
UserSettings/
CodeCoverage/
InitTestScene*
Expand Down
128 changes: 128 additions & 0 deletions Assets/Empty.unity
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots: []
7 changes: 7 additions & 0 deletions Assets/Empty.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Assets/PlayModeTests/Robot2DControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Robot2DControllerTest {
private const int RandomSeed = 123;
private MySimulator _maes;
private TestingAlgorithm _testAlgorithm;
private ExplorationSimulation _simulationBase;
private ExplorationSimulation _explorationSimulation;
private MonaRobot _robot;

private float _relativeMoveSpeed;
Expand All @@ -65,8 +65,8 @@ public void InitializeTestingSimulator() {

_maes = MySimulator.GetInstance();
_maes.EnqueueScenario(testingScenario);
_simulationBase = _maes.GetSimulationManager().CurrentSimulation;
_robot = _simulationBase.Robots[0];
_explorationSimulation = _maes.GetSimulationManager().CurrentSimulation;
_robot = _explorationSimulation.Robots[0];
}

[TearDown]
Expand Down Expand Up @@ -101,9 +101,9 @@ public IEnumerator MoveTo_IsDistanceCorrectTest(float movementDistance) {
}

// Wait 1 second (10 ticks) for the robot to stand completely still
var movementTaskEndTick = _simulationBase.SimulatedLogicTicks;
var movementTaskEndTick = _explorationSimulation.SimulatedLogicTicks;
const int ticksToWait = 10;
while (_simulationBase.SimulatedLogicTicks < movementTaskEndTick + ticksToWait) yield return null;
while (_explorationSimulation.SimulatedLogicTicks < movementTaskEndTick + ticksToWait) yield return null;

// Assert that the actual final position approximately matches the expected final position
var endingPosition = _robot.transform.position;
Expand Down Expand Up @@ -139,9 +139,9 @@ public IEnumerator Rotate_RotatesCorrectAmountOfDegrees(float degreesToRotate) {
while (_testAlgorithm.Tick < 10 || _testAlgorithm.Controller.GetStatus() != RobotStatus.Idle)
yield return null;
// Wait 1 second (10 ticks) for the robot to stand completely still
var movementTaskEndTick = _simulationBase.SimulatedLogicTicks;
var movementTaskEndTick = _explorationSimulation.SimulatedLogicTicks;
const int ticksToWait = 10;
while (_simulationBase.SimulatedLogicTicks < movementTaskEndTick + ticksToWait) yield return null;
while (_explorationSimulation.SimulatedLogicTicks < movementTaskEndTick + ticksToWait) yield return null;

// Assert that the actual final rotation approximately matches the expected angle
var actualAngle = _robot.transform.rotation.eulerAngles.z;
Expand Down
Loading
Loading