Skip to content

Commit

Permalink
Configured pipeline for Crypto Shredding .NET samples
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed Aug 6, 2021
1 parent 2fd2a07 commit 7d05613
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 45 deletions.
71 changes: 35 additions & 36 deletions .github/workflows/build.cqrs_flow.dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build CQRS Flow .NET

on:
push:
Expand All @@ -11,38 +11,37 @@ defaults:
working-directory: ./CQRS_Flow/.NET/

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v1

- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"

- name: Restore NuGet packages
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Run tests
run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"

- name: Publish test results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Results
reporter: dotnet-trx
path: '**/test-results.trx'

- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v1

- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"

- name: Restore NuGet packages
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Run tests
run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"

- name: Upload test results
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: test-results
path: "**/test-results.trx"

- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
47 changes: 47 additions & 0 deletions .github/workflows/build.crypto_shredding.dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Crypto Shredding .NET

on:
push:
branches:
- main
pull_request:

defaults:
run:
working-directory: ./Crypto_Shredding/.NET

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v1

- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"

- name: Restore NuGet packages
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Run tests
run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"

- name: Upload test results
uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: test-results
path: "**/test-results.trx"

- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
21 changes: 21 additions & 0 deletions .github/workflows/build.dotnet.testreport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test Report

on:
workflow_run:
workflows: ["Build CQRS Flow .NET", "Build Crypto Shredding .NET"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Publish test results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Results
artifact: test-results
reporter: dotnet-trx
path: "**/test-results.trx"
fail-on-error: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)/bin/TestResults/$(TargetFramework)</VSTestResultsDirectory>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CryptoShredding\CryptoShredding.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>.net5.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 7d05613

Please sign in to comment.