forked from Pryaxis/TShock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Single file publish support, test project and simple build CI
This also adds remote raspberry pi debugging with default install details. More testing is required as MonoMod may not be working for arm64 still CI might not work yet either
- Loading branch information
1 parent
c159f2b
commit 2c36dac
Showing
8 changed files
with
239 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CI(OTAPI3) | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.100' | ||
|
||
- name: MonoMod dev build | ||
run: dotnet nuget add source https://pkgs.dev.azure.com/MonoMod/MonoMod/_packaging/DevBuilds%40Local/nuget/v3/index.json -n DevBuilds@Local | ||
|
||
- name: Run tests | ||
run: dotnet test | ||
|
||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
arch: ["win-x64", "osx-x64", "linux-x64", "linux-arm64", "linux-arm"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.100' | ||
|
||
- name: MonoMod dev build | ||
run: dotnet nuget add source https://pkgs.dev.azure.com/MonoMod/MonoMod/_packaging/DevBuilds%40Local/nuget/v3/index.json -n DevBuilds@Local | ||
|
||
- name: Produce build | ||
run: dotnet publish -r ${{ matrix.mode }} -f net6.0 -c Release -p:PublishSingleFile=true --self-contained true |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
using System.Diagnostics; | ||
using System.Threading; | ||
|
||
namespace TShockLauncher.Tests | ||
{ | ||
[TestClass] | ||
public class ServerInitTests | ||
{ | ||
[TestMethod] | ||
public void EnsureBoots() | ||
{ | ||
var are = new AutoResetEvent(false); | ||
On.Terraria.Main.hook_DedServ cb = (On.Terraria.Main.orig_DedServ orig, Terraria.Main instance) => | ||
{ | ||
are.Set(); | ||
Debug.WriteLine("Server init process successful"); | ||
}; | ||
On.Terraria.Main.DedServ += cb; | ||
|
||
new Thread(() => TerrariaApi.Server.Program.Main(new string[] { })).Start(); | ||
|
||
var hit = are.WaitOne(TimeSpan.FromSeconds(10)); | ||
|
||
On.Terraria.Main.DedServ -= cb; | ||
|
||
Assert.AreEqual(true, hit); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" /> | ||
<PackageReference Include="coverlet.collector" Version="3.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\TShockLauncher\TShockLauncher.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
Submodule TerrariaServerAPI
updated
from a0b3da to a7949a