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

CICD #204

Merged
merged 78 commits into from
Feb 6, 2024
Merged

CICD #204

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
9978ec1
Demo support
konraddysput Jan 31, 2024
1d638b9
Demo support
konraddysput Jan 31, 2024
0b5906f
Project path
konraddysput Jan 31, 2024
6d2cd79
Print more info about the directory structure
konraddysput Jan 31, 2024
8eef5f7
Print more diagnostic info
konraddysput Jan 31, 2024
e606760
repair symlink
konraddysput Jan 31, 2024
fa0c597
Copy manually folders
konraddysput Jan 31, 2024
2e9e63a
Revert: Copy manually folders
konraddysput Jan 31, 2024
c8a18a4
Manually create a project
konraddysput Jan 31, 2024
a8e7110
Copy without symlinks
konraddysput Jan 31, 2024
fd1690d
Correct copy directory
konraddysput Jan 31, 2024
9cc68d8
Correct copy directory
konraddysput Jan 31, 2024
d43a583
Correct copy directory
konraddysput Jan 31, 2024
c507673
Prepare folder
konraddysput Jan 31, 2024
81f5238
Remove demo project from assets
konraddysput Jan 31, 2024
5122989
Remove demo project from assets
konraddysput Jan 31, 2024
ae03142
Do not copy symlinks recursive
konraddysput Jan 31, 2024
5376c43
Drop symlink
konraddysput Jan 31, 2024
e97f233
Move project to the dir
konraddysput Jan 31, 2024
c304529
Use package
konraddysput Jan 31, 2024
a218023
Use different unity version
konraddysput Jan 31, 2024
b9c3d4d
package link
konraddysput Jan 31, 2024
49ae14c
correct YAML file
konraddysput Jan 31, 2024
ff350d4
correct YAML file
konraddysput Jan 31, 2024
173037b
fix YAML
konraddysput Jan 31, 2024
a07f21e
See the directory
konraddysput Jan 31, 2024
58656cd
Correct project path
konraddysput Jan 31, 2024
479a345
Drop demo for now
konraddysput Jan 31, 2024
f390f0c
Use package directory insted
konraddysput Jan 31, 2024
d83e44a
Bring back backtrace untiy reference
konraddysput Jan 31, 2024
346d06e
Use example test
konraddysput Jan 31, 2024
4075ac8
yaml formatting
konraddysput Jan 31, 2024
e7c2eee
yaml formatting
konraddysput Jan 31, 2024
307e6ac
yaml formatting
konraddysput Jan 31, 2024
aab2e4a
Project path
konraddysput Jan 31, 2024
04d1446
1 level project path
konraddysput Jan 31, 2024
fbc94a7
package name
konraddysput Jan 31, 2024
57c1a3c
Use different test action
konraddysput Jan 31, 2024
ce7a4d9
Bring back previous configuration
konraddysput Jan 31, 2024
a053007
Generate manually a game and add SDK to it
konraddysput Feb 2, 2024
f96efd9
Correct project path
konraddysput Feb 2, 2024
9023f03
Correct project path
konraddysput Feb 2, 2024
5262c94
Downgrade version and use custom parameters
konraddysput Feb 2, 2024
a0be420
revert: Downgrade version and use custom parameters
konraddysput Feb 2, 2024
30e523b
Drop unused env variables
konraddysput Feb 2, 2024
cca2225
use cache and bring back env var
konraddysput Feb 2, 2024
e3bd765
Different approach to build and test app
konraddysput Feb 5, 2024
1b2d16b
Changed unity version
konraddysput Feb 5, 2024
fb8904b
Remove plugins directory
konraddysput Feb 5, 2024
78edd95
Clean up demo before copy-pasting it
konraddysput Feb 5, 2024
9f7d815
Simplify example
konraddysput Feb 5, 2024
c11ac56
Add correct unity license
konraddysput Feb 5, 2024
7b47dd4
Use serial
konraddysput Feb 5, 2024
5453b3d
Merge branch 'master' into improvement/demo
konraddysput Feb 5, 2024
e7eb575
Use different unity version
konraddysput Feb 5, 2024
e874d82
Specific runner version
konraddysput Feb 5, 2024
71c757b
For testing purposes remove WaitForEndOfFrame
konraddysput Feb 5, 2024
c0cac82
fix tests
konraddysput Feb 5, 2024
50d8f6b
fix tests
konraddysput Feb 5, 2024
883b185
Different test
konraddysput Feb 5, 2024
718c928
Waiter abstraction
konraddysput Feb 5, 2024
3beeaff
Add missing namespace
konraddysput Feb 5, 2024
13a196c
Comp fixes
konraddysput Feb 6, 2024
05de1d3
Bring back yield return to tests
konraddysput Feb 6, 2024
a287563
Test against different unity versions
konraddysput Feb 6, 2024
c90177f
Header name
konraddysput Feb 6, 2024
763e842
Bump 2018 version
konraddysput Feb 6, 2024
27603a0
Bump unity versions to the latest lts
konraddysput Feb 6, 2024
8904b24
Clean up the code
konraddysput Feb 6, 2024
ac7add6
Try to build a game
konraddysput Feb 6, 2024
2ddaf86
Use serial
konraddysput Feb 6, 2024
3e123a5
Build name
konraddysput Feb 6, 2024
a473f98
Divide workflow into two separated actions
konraddysput Feb 6, 2024
91ce591
Project path
konraddysput Feb 6, 2024
285c3ca
Use specific untiy version
konraddysput Feb 6, 2024
43dc361
Allow dirty
konraddysput Feb 6, 2024
e685664
Drop untiy version due to license issues and update build task name
konraddysput Feb 6, 2024
59147c2
Change triggering conditions
konraddysput Feb 6, 2024
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
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build package

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Run Build for ${{ matrix.unityVersion }} ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- test-package
unityVersion:
- 2019.4.40f1
targetPlatform:
- StandaloneOSX
- StandaloneWindows
- StandaloneWindows64
- StandaloneLinux64
- iOS
- Android
- WebGL
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
lfs: true

- name: Setup Environment
run: |
mkdir ${{ matrix.projectPath }}
mv Editor Runtime Tests Android iOS Windows package.json ${{ matrix.projectPath }}/

- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/[email protected]

- uses: game-ci/unity-builder@v4
name: Build game for platform ${{ matrix.targetPlatform }}
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: ${{ matrix.projectPath }}/
allowDirtyBuild: true
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test package

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Run Tests in ${{ matrix.testMode }} ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
testMode:
- playmode
# - editmode
projectPath:
- test-package
unityVersion:
- 2022.3.19f1
- 2019.4.40f1
- 2020.3.48f1
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
lfs: true

- name: Setup Environment
run: |
mkdir ${{ matrix.projectPath }}
mv Editor Runtime Tests Android iOS Windows package.json ${{ matrix.projectPath }}/

- name: Run Tests
uses: game-ci/[email protected]
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
packageMode: true
projectPath: ${{ matrix.projectPath }}/
testMode: ${{ matrix.testMode }}
unityVersion: ${{ matrix.unityVersion }}
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*"
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Runtime/BacktraceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ private IEnumerator CollectDataAndSend(BacktraceReport report, Action<BacktraceR

if (Database != null && Database.Enabled())
{
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
if (EnablePerformanceStatistics)
{
stopWatch.Restart();
Expand Down Expand Up @@ -885,7 +885,7 @@ record = Database.Add(data);
stopWatch.Stop();
queryAttributes["performance.json"] = stopWatch.GetMicroseconds();
}
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
if (string.IsNullOrEmpty(json))
{
yield break;
Expand Down
25 changes: 25 additions & 0 deletions Runtime/Model/WaitForFrame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Backtrace.Unity.Model.Waiter;
using UnityEngine;

namespace Backtrace.Unity.Model
{
public class WaitForFrame
{
private static IWaiter _waiter = CreateWaiterStrategy();

public static YieldInstruction Wait()
{
return _waiter.Wait();
}

private static IWaiter CreateWaiterStrategy()
{
if (Application.isBatchMode)
{
return new BatchModeWaiter();
}

return new EndOfFrameWaiter();
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Model/WaitForFrame.cs.meta

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

8 changes: 8 additions & 0 deletions Runtime/Waiter.meta

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

12 changes: 12 additions & 0 deletions Runtime/Waiter/BatchModeWaiter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;

namespace Backtrace.Unity.Model.Waiter
{
public class BatchModeWaiter : IWaiter
{
public YieldInstruction Wait()
{
return null;
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Waiter/BatchModeWaiter.cs.meta

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

12 changes: 12 additions & 0 deletions Runtime/Waiter/EndOfFrameWaiter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UnityEngine;

namespace Backtrace.Unity.Model.Waiter
{
public class EndOfFrameWaiter : IWaiter
{
public YieldInstruction Wait()
{
return new WaitForEndOfFrame();
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Waiter/EndOfFrameWaiter.cs.meta

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

10 changes: 10 additions & 0 deletions Runtime/Waiter/IWaiter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections;
using UnityEngine;

namespace Backtrace.Unity.Model.Waiter
{
public interface IWaiter
{
YieldInstruction Wait();
}
}
11 changes: 11 additions & 0 deletions Runtime/Waiter/IWaiter.cs.meta

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

8 changes: 4 additions & 4 deletions Tests/Runtime/BacktraceAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IEnumerator TesClientAttributeAccessor_BacktraceDataShouldIncludeClientAt
return null;
};
BacktraceClient.Send(new Exception("foo"));
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
Assert.IsNotNull(data);
Assert.AreEqual(data.Attributes.Attributes[key], value);
yield return null;
Expand All @@ -60,9 +60,9 @@ public IEnumerator TesClientAttributes_ReportShouldntExtendClientAttributes_Clie
foreach (var exceptionMessage in exceptionsMessage)
{
BacktraceClient.Send(new Exception(exceptionMessage));
yield return new WaitForEndOfFrame();
}

}
yield return WaitForFrame.Wait();
Assert.AreEqual(data.Attributes.Attributes[key], value);
Assert.AreEqual(numberOfKeysBeforeSendRequest, BacktraceClient.GetAttributesCount());
yield return null;
Expand All @@ -85,7 +85,7 @@ public IEnumerator TesClientAttributesMethod_BacktraceDataShouldIncludeClientAtt
return null;
};
BacktraceClient.Send(new Exception("foo"));
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();

Assert.IsNotNull(data);
Assert.AreEqual(data.Attributes.Attributes[key], value);
Expand Down
15 changes: 9 additions & 6 deletions Tests/Runtime/BacktraceClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public IEnumerator TestBeforeSendEvent_UpdateReportAttributesForUnhandledExcepti

var unhandledException = new BacktraceUnhandledException("foo", string.Empty);
BacktraceClient.Send(unhandledException);
yield return null;
yield return WaitForFrame.Wait();
}

[UnityTest]
Expand All @@ -108,7 +108,7 @@ public IEnumerator TestBeforeSendEvent_ValidConfiguration_EventTrigger()
return backtraceData;
};
BacktraceClient.Send(new Exception("test exception"));
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
Assert.IsTrue(trigger);
yield return null;
}
Expand All @@ -128,7 +128,7 @@ public IEnumerator TestSendingReport_ValidConfiguration_ValidSend()
return new BacktraceResult();
};
BacktraceClient.Send(new Exception("test exception"));
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
Assert.IsTrue(trigger);
yield return null;
}
Expand Down Expand Up @@ -217,9 +217,10 @@ public IEnumerator TestFingerprintBehaviorForNormalizedExceptionMessage_ShouldUs
return null;
};
BacktraceClient.Send(report);
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();

Assert.IsTrue(eventFired);
yield return null;
}

[Test]
Expand Down Expand Up @@ -284,15 +285,17 @@ public IEnumerator TestFingerprintBehaviorForNormalizedExceptionMessage_Shouldnt
return null;
};
BacktraceClient.Send(report);
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();
Assert.IsTrue(eventFired);
yield return null;
}


private IEnumerator CallBacktraceClientAndWait(BacktraceReport report)
{
BacktraceClient.Send(report);
yield return new WaitForEndOfFrame();
yield return WaitForFrame.Wait();

}
}
}
Loading
Loading