Skip to content

Commit

Permalink
Merge pull request #503 from baynezy/feature/issue-502-mutation
Browse files Browse the repository at this point in the history
Add mutation testing to feature branches
  • Loading branch information
baynezy authored Jan 1, 2025
2 parents 1c75c50 + a98582c commit bdf90d3
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/branch-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ jobs:
check-markdown:
needs: [get-version]
uses: ./.github/workflows/step-check-markdown.yml
secrets: inherit
secrets: inherit

mutation-testing:
needs: [get-version]
uses: ./.github/workflows/step-mutation-testing.yml
secrets: inherit
with:
comparison: ${{ github.base_ref }}
34 changes: 34 additions & 0 deletions .github/workflows/step-mutation-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
workflow_call:
inputs:
comparison:
type: string
description: 'The comparison to use for the mutation testing'
required: true
env:
MAJOR_DOTNET_VERSION: 8
TestPath: /home/runner/work/Html2Markdown/Html2Markdown/test/Html2Markdown.Test/Files/

jobs:
mutation-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.MAJOR_DOTNET_VERSION }}.0.x
- name: Install Stryker
run: |
dotnet tool install -g dotnet-stryker
- name: Run Stryker
run: |
dotnet stryker --since:${{ inputs.comparison }}
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: Mutation-Report
path: ./StrykerOutput/*/reports/mutation-report.html
1 change: 1 addition & 0 deletions Html2Markdown.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
semver.json = semver.json
LICENSE.txt = LICENSE.txt
stryker-config.json = stryker-config.json
EndProjectSection
EndProject
Global
Expand Down
21 changes: 21 additions & 0 deletions stryker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"stryker-config":
{
"solution": "Html2Markdown.sln",
"project": "Html2Markdown.csproj",
"thresholds": {
"high": 95,
"low": 85,
"break": 80
},
"since": {
"target": "develop",
"ignore-changes-in": [
"**/*.md",
"**/*.yml",
"**/*.json",
"**/*.txt"
]
}
}
}

0 comments on commit bdf90d3

Please sign in to comment.