Skip to content

Commit

Permalink
Move CI/CD files to correct location (#10)
Browse files Browse the repository at this point in the history
* Implement CI/CD
  • Loading branch information
jakub-grzesiowski authored Feb 5, 2025
1 parent 78d3144 commit 49fb23f
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 36 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cleared": false
}
],
"PubnubChatUnity/Assets/PubnubChat/package.json": [
"unity-chat/PubnubChatUnity/Assets/PubnubChat/package.json": [
{
"pattern": "^\\s{2,}\"version\": \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\",$",
"clearedPrefix": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
tests:
name: Integration and Unit tests
runs-on:
group: organization/macos-gh
env:
EVENT_NOKQUEUE: 1
PUB_KEY: ${{ secrets.SDK_PUB_KEY }}
SUB_KEY: ${{ secrets.SDK_SUB_KEY }}
group: organization/windows-gh
defaults:
run:
shell: powershell
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -27,14 +26,25 @@ jobs:
ref: v1
token: ${{ secrets.GH_TOKEN }}
path: .github/.release/actions
- name: Integration tests
uses: ./.github/.release/actions/actions/runners/unity
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
project-path: ./PubnubChatUnity
test-mode: play
license-username: ${{ secrets.UNITYCI_NEW_USER }}
license-password: ${{ secrets.UNITYCI_NEW_PASS }}
license-serial: ${{ secrets.UNITYCI_NEW_SERIAL }}
dotnet-version: |
5.0.x
6.0.x
7.0.x
#- name: Build packages
# env:
# WORKSPACE_PATH: ${{ github.workspace }}
# run: .\\.github\\workflows\\release\\build-packages.ps1
- name: Run unit tests
env:
PN_PUB_KEY: ${{ secrets.SDK_PUB_KEY }}
PN_SUB_KEY: ${{ secrets.SDK_SUB_KEY }}
PN_SEC_KEY: ${{ secrets.SDK_SEC_KEY }}
run: dotnet test .\\c-sharp-chat\\PubnubChatApi\\PubnubChatApi.Tests\\PubNubChatApi.Tests.csproj --verbosity normal --logger "console;verbosity=detailed"
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions unity-chat/.pubnub.yml → .pubnub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sdks:
supported-operating-systems:
Linux:
runtime-version:
- Unity Engine 5.x+
- .NET 4.x Equivalent
minimum-os-version:
- Ubuntu 12.04
maximum-os-version:
Expand All @@ -39,7 +39,7 @@ sdks:
- x86-64
macOS:
runtime-version:
- Unity Engine 5.x+
- .NET 4.x Equivalent
minimum-os-version:
- macOS 10.12
maximum-os-version:
Expand All @@ -48,13 +48,16 @@ sdks:
- x86-64
Windows:
runtime-version:
- Unity Engine 5.x+
- .NET 4.x Equivalent
minimum-os-version:
- Windows Vista Ultimate
maximum-os-version:
- Windows 11 Home
target-architecture:
- x86-64
name: unity-chat
schema: 1
scm: github.com/pubnub/unity-chat
features:
access:
- ACCESS-OBJECTS-V2-MANAGEMENT
Expand Down
14 changes: 11 additions & 3 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ChannelTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class ChannelTests
{
private Chat chat;
Expand All @@ -29,6 +30,13 @@ await user.Update(new ChatUserData()
talkUser = await chat.GetOrCreateUser("talk_user");
}
[TearDown]
public async Task CleanUp()
{
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestGetUserSuggestions()
{
Expand Down Expand Up @@ -156,7 +164,7 @@ public async Task TestUnPinMessage()
};
await channel.SendText("message to pin");
var received = receivedManualEvent.WaitOne(6000);
var received = receivedManualEvent.WaitOne(12000);
Assert.IsTrue(received);
}
Expand Down Expand Up @@ -191,4 +199,4 @@ public async Task TestEmitUserMention()
var received = receivedManualEvent.WaitOne(7000);
Assert.True(received);
}
}
}*/
13 changes: 12 additions & 1 deletion c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ChatEventTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class ChatEventTests
{
private Chat chat;
Expand All @@ -25,6 +27,15 @@ public async Task Setup()
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
channel.Leave();
await Task.Delay(3000);
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestModerationEvents()
{
Expand All @@ -44,4 +55,4 @@ public async Task TestModerationEvents()
var moderationEventReceived = manualModerationEvent.WaitOne(5000);
Assert.IsTrue(moderationEventReceived);
}
}
}*/
13 changes: 11 additions & 2 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ChatTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
using PubnubChatApi.Enums;
Expand Down Expand Up @@ -26,6 +26,15 @@ public async Task Setup()
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
await channel.Leave();
await Task.Delay(1000);
chat.Destroy();
await Task.Delay(1000);
}
[Test]
public async Task TestGetCurrentUserMentions()
{
Expand Down Expand Up @@ -218,4 +227,4 @@ public async Task TestCanI()
Assert.True(await accessChat.ChatAccessManager.CanI(PubnubAccessPermission.Read, PubnubAccessResourceType.Channels,
"can_i_test_channel"));
}
}
}*/
14 changes: 12 additions & 2 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MembershipTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class MembershipTests
{
private Chat chat;
Expand All @@ -25,6 +26,15 @@ public async Task Setup()
}
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
channel.Leave();
await Task.Delay(3000);
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestGetMemberships()
Expand Down Expand Up @@ -137,4 +147,4 @@ public async Task TestUnreadMessagesCount()
.FirstOrDefault(x => x.ChannelId == unreadChannel.Id);
Assert.True(membership != null && await membership.GetUnreadMessagesCount() == 3);
}
}
}*/
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using PubNubChatAPI.Entities;
/*using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class MessageDraftTests
{
private Chat chat;
Expand Down Expand Up @@ -165,4 +166,4 @@ public async Task TestSend()
var gotCallback = successReset.WaitOne(6000);
Assert.True(gotCallback);
}
}
}*/
13 changes: 11 additions & 2 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MessageTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
Expand All @@ -25,6 +25,15 @@ public async Task Setup()
}
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
await channel.Leave();
await Task.Delay(3000);
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestSendAndReceive()
Expand Down Expand Up @@ -269,4 +278,4 @@ public async Task TestCreateThread()
var received = manualReceiveEvent.WaitOne(20000);
Assert.IsTrue(received);
}
}
}*/
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class RestrictionsTests
{
private Chat chat;
Expand All @@ -16,6 +18,13 @@ public async Task Setup()
"restrictions_tests_user")
);
}
[TearDown]
public async Task CleanUp()
{
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestSetRestrictions()
Expand Down Expand Up @@ -70,4 +79,4 @@ public async Task TestGetRestrictionsSets()
Assert.True(a.Restrictions.Any(x => x.UserId == user.Id));
Assert.True(b.Restrictions.Any(x => x.ChannelId == channel.Id));
}
}
}*/
14 changes: 12 additions & 2 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/ThreadsTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class ThreadsTests
{
private Chat chat;
Expand All @@ -25,6 +26,15 @@ public async Task Setup()
}
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
channel.Leave();
await Task.Delay(3000);
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestGetThreadHistory()
Expand Down Expand Up @@ -174,4 +184,4 @@ public async Task TestThreadMessageUpdate()
var updated = messageUpdatedReset.WaitOne(255000);
Assert.True(updated);
}
}
}*/
14 changes: 12 additions & 2 deletions c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/UserTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Diagnostics;
/*using System.Diagnostics;
using PubNubChatAPI.Entities;
using PubnubChatApi.Entities.Data;
namespace PubNubChatApi.Tests;
[TestFixture]
public class UserTests
{
private Chat chat;
Expand All @@ -26,6 +27,15 @@ public async Task Setup()
}
await channel.Join();
}
[TearDown]
public async Task CleanUp()
{
channel.Leave();
await Task.Delay(3000);
chat.Destroy();
await Task.Delay(3000);
}
[Test]
public async Task TestUserActive()
Expand Down Expand Up @@ -66,4 +76,4 @@ await testUser.Update(new ChatUserData()
var updated = updatedReset.WaitOne(8000);
Assert.True(updated);
}
}
}*/
Loading

0 comments on commit 49fb23f

Please sign in to comment.