Skip to content

Commit 5073999

Browse files
authored
CICD (#204)
* Demo support * Demo support * Project path * Print more info about the directory structure * Print more diagnostic info * repair symlink * Copy manually folders * Revert: Copy manually folders * Manually create a project * Copy without symlinks * Correct copy directory * Correct copy directory * Correct copy directory * Prepare folder * Remove demo project from assets * Remove demo project from assets * Do not copy symlinks recursive * Drop symlink * Move project to the dir * Use package * Use different unity version * package link * correct YAML file * correct YAML file * fix YAML * See the directory * Correct project path * Drop demo for now * Use package directory insted * Bring back backtrace untiy reference * Use example test * yaml formatting * yaml formatting * yaml formatting * Project path * 1 level project path * package name * Use different test action * Bring back previous configuration * Generate manually a game and add SDK to it * Correct project path * Correct project path * Downgrade version and use custom parameters * revert: Downgrade version and use custom parameters * Drop unused env variables * use cache and bring back env var * Different approach to build and test app * Changed unity version * Remove plugins directory * Clean up demo before copy-pasting it * Simplify example * Add correct unity license * Use serial * Use different unity version * Specific runner version * For testing purposes remove WaitForEndOfFrame * fix tests * fix tests * Different test * Waiter abstraction * Add missing namespace * Comp fixes * Bring back yield return to tests * Test against different unity versions * Header name * Bump 2018 version * Bump unity versions to the latest lts * Clean up the code * Try to build a game * Use serial * Build name * Divide workflow into two separated actions * Project path * Use specific untiy version * Allow dirty * Drop untiy version due to license issues and update build task name * Change triggering conditions
1 parent dc0e304 commit 5073999

21 files changed

+297
-84
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build package
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Run Build for ${{ matrix.unityVersion }} ${{ matrix.unityVersion }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
projectPath:
16+
- test-package
17+
unityVersion:
18+
- 2019.4.40f1
19+
targetPlatform:
20+
- StandaloneOSX
21+
- StandaloneWindows
22+
- StandaloneWindows64
23+
- StandaloneLinux64
24+
- iOS
25+
- Android
26+
- WebGL
27+
steps:
28+
- name: Checkout Repo
29+
uses: actions/checkout@v4
30+
with:
31+
lfs: true
32+
33+
- name: Setup Environment
34+
run: |
35+
mkdir ${{ matrix.projectPath }}
36+
mv Editor Runtime Tests Android iOS Windows package.json ${{ matrix.projectPath }}/
37+
38+
- if: matrix.targetPlatform == 'Android'
39+
uses: jlumbroso/free-disk-space@v1.3.1
40+
41+
- uses: game-ci/unity-builder@v4
42+
name: Build game for platform ${{ matrix.targetPlatform }}
43+
env:
44+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
45+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
46+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
47+
with:
48+
unityVersion: ${{ matrix.unityVersion }}
49+
targetPlatform: ${{ matrix.targetPlatform }}
50+
projectPath: ${{ matrix.projectPath }}/
51+
allowDirtyBuild: true

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test package
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Run Tests in ${{ matrix.testMode }} ${{ matrix.unityVersion }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
testMode:
16+
- playmode
17+
# - editmode
18+
projectPath:
19+
- test-package
20+
unityVersion:
21+
- 2022.3.19f1
22+
- 2019.4.40f1
23+
- 2020.3.48f1
24+
steps:
25+
- name: Checkout Repo
26+
uses: actions/checkout@v4
27+
with:
28+
lfs: true
29+
30+
- name: Setup Environment
31+
run: |
32+
mkdir ${{ matrix.projectPath }}
33+
mv Editor Runtime Tests Android iOS Windows package.json ${{ matrix.projectPath }}/
34+
35+
- name: Run Tests
36+
uses: game-ci/unity-test-runner@v4.0.0
37+
env:
38+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
39+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
40+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
41+
with:
42+
packageMode: true
43+
projectPath: ${{ matrix.projectPath }}/
44+
testMode: ${{ matrix.testMode }}
45+
unityVersion: ${{ matrix.unityVersion }}
46+
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*"

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

Runtime/BacktraceClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ private IEnumerator CollectDataAndSend(BacktraceReport report, Action<BacktraceR
839839

840840
if (Database != null && Database.Enabled())
841841
{
842-
yield return new WaitForEndOfFrame();
842+
yield return WaitForFrame.Wait();
843843
if (EnablePerformanceStatistics)
844844
{
845845
stopWatch.Restart();
@@ -885,7 +885,7 @@ record = Database.Add(data);
885885
stopWatch.Stop();
886886
queryAttributes["performance.json"] = stopWatch.GetMicroseconds();
887887
}
888-
yield return new WaitForEndOfFrame();
888+
yield return WaitForFrame.Wait();
889889
if (string.IsNullOrEmpty(json))
890890
{
891891
yield break;

Runtime/Model/WaitForFrame.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Backtrace.Unity.Model.Waiter;
2+
using UnityEngine;
3+
4+
namespace Backtrace.Unity.Model
5+
{
6+
public class WaitForFrame
7+
{
8+
private static IWaiter _waiter = CreateWaiterStrategy();
9+
10+
public static YieldInstruction Wait()
11+
{
12+
return _waiter.Wait();
13+
}
14+
15+
private static IWaiter CreateWaiterStrategy()
16+
{
17+
if (Application.isBatchMode)
18+
{
19+
return new BatchModeWaiter();
20+
}
21+
22+
return new EndOfFrameWaiter();
23+
}
24+
}
25+
}

Runtime/Model/WaitForFrame.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/Waiter.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/Waiter/BatchModeWaiter.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using UnityEngine;
2+
3+
namespace Backtrace.Unity.Model.Waiter
4+
{
5+
public class BatchModeWaiter : IWaiter
6+
{
7+
public YieldInstruction Wait()
8+
{
9+
return null;
10+
}
11+
}
12+
}

Runtime/Waiter/BatchModeWaiter.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/Waiter/EndOfFrameWaiter.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using UnityEngine;
2+
3+
namespace Backtrace.Unity.Model.Waiter
4+
{
5+
public class EndOfFrameWaiter : IWaiter
6+
{
7+
public YieldInstruction Wait()
8+
{
9+
return new WaitForEndOfFrame();
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)