Skip to content

Commit

Permalink
chore: test stryker dashboard report
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-shirbandi committed Oct 8, 2023
1 parent 39066cb commit 7c27c34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Tool Restor
run: ./build.ps1 RestoreDotNetTool --skip
- name: Build
run: ./build.ps1 Compile
- name: Unit Test
run: ./build.ps1 RunUnitTests --skip Compile
- name: Mutation Test
working-directory: ./src/2-Services/Identity/Tests/Identity.Tests.Unit
run: dotnet stryker --reporter dashboard --dashboard-api-key 8dddccf5-538c-4388-ada2-791a98293fe2
run: ./build.ps1 RunMutationTests --skip RunUnitTests
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
10 changes: 5 additions & 5 deletions src/6-Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ class Build : NukeBuild
.DependsOn(RunUnitTests,RestoreDotNetTool)
.Executes(() =>
{
//It will add dashboard report for CI
string report = "--reporter dashboard";
//It will add dashboard reporter for CI
string reporter = "--reporter dashboard";

//It just uses the reports specified in reports section in stryker-config.json
//It just uses the reporters specified in reporters section in stryker-config.json
if (IsLocalBuild)
report = "";
reporter = "";

var testProjects = Solution.AllProjects.Where(s => s.Name.EndsWith(".Tests.Unit"));

foreach (var testProject in testProjects)
DotNet(workingDirectory: testProject.Directory, arguments: $"dotnet-stryker {report}");
DotNet(workingDirectory: testProject.Directory, arguments: $"dotnet-stryker {reporter}");
});
}

0 comments on commit 7c27c34

Please sign in to comment.