diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..111e8d7 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,52 @@ +name: MTSC CD Pipeline + +on: + push: + branches: + - master + +jobs: + + build: + environment: Default + strategy: + matrix: + targetplatform: [x64] + + runs-on: windows-latest + + env: + Configuration: Release + Solution_Path: MTSC.sln + Test_Project_Path: MTSC.UnitTests\MTSC.UnitTests.csproj + Source_Project_Path: MTSC\MTSC.csproj + Actions_Allow_Unsecure_Commands: true + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '5.0.202' + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.1 + + - name: Restore project + run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier + env: + RuntimeIdentifier: win-${{ matrix.targetplatform }} + + - name: Build MTSC project + run: dotnet build MTSC -c $env:Configuration + + - name: Push nuget package + uses: brandedoutcast/publish-nuget@v2.5.5 + with: + PROJECT_FILE_PATH: MTSC\MTSC.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}} + \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5c6b2ac --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,48 @@ +name: MTSC CI Pipeline + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + + build: + + strategy: + matrix: + targetplatform: [x64] + + runs-on: windows-latest + + env: + Solution_Path: MTSC.sln + Test_Project_Path: MTSC.UnitTests\MTSC.UnitTests.csproj + Source_Project_Path: MTSC\MTSC.csproj + Actions_Allow_Unsecure_Commands: true + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '5.0.202' + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.1 + + - name: Execute Unit Tests + run: dotnet test $env:Test_Project_Path -v n --filter "TestCategory!=ServerTests" + + - name: Restore Project + run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier + env: + Configuration: Debug + RuntimeIdentifier: win-${{ matrix.targetplatform }} \ No newline at end of file diff --git a/MTSC.UnitTests/E2ETests.cs b/MTSC.UnitTests/E2ETests.cs index 51edd77..af7fb73 100644 --- a/MTSC.UnitTests/E2ETests.cs +++ b/MTSC.UnitTests/E2ETests.cs @@ -26,6 +26,7 @@ using System.Web; namespace MTSC.UnitTests { [TestClass] + [TestCategory("ServerTests")] public class E2ETests { private volatile byte[] receivedMessage = null; diff --git a/MTSC.UnitTests/MTSC.UnitTests.csproj b/MTSC.UnitTests/MTSC.UnitTests.csproj index 0feeb42..396de1a 100644 --- a/MTSC.UnitTests/MTSC.UnitTests.csproj +++ b/MTSC.UnitTests/MTSC.UnitTests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.0 + net5.0 false diff --git a/MTSC.UnitTests/ServerTests.cs b/MTSC.UnitTests/ServerTests.cs index 696b90b..02d0125 100644 --- a/MTSC.UnitTests/ServerTests.cs +++ b/MTSC.UnitTests/ServerTests.cs @@ -5,6 +5,7 @@ using System.Threading; namespace MTSC.UnitTests { [TestClass] + [TestCategory("ServerTests")] public class ServerTests { [TestMethod]