Skip to content

Commit

Permalink
feat: Enable Stryker CI-Build (#107)
Browse files Browse the repository at this point in the history
* Enable Stryker PR comment

* Keep using upload action v4
  • Loading branch information
vbreuss authored Apr 1, 2024
1 parent 976f92c commit 3899f7c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
shell: bash
run: |
cd Tests
../../tools/dotnet-stryker -f ../.github/stryker/Stryker.Config.json -v "${GITHUB_HEAD_REF}" -r "html" -r "cleartext" --since:main
../../tools/dotnet-stryker -f ../.github/stryker/Stryker.Config.json -v "${GITHUB_HEAD_REF}" -r "Dashboard" -r "html" -r "cleartext" --since:main
mv ./StrykerOutput/**/reports/*.html ./StrykerOutput/Reports/Testably.Abstractions.FluentAssertions-report.html
- name: Upload Stryker reports
uses: actions/upload-artifact@v4
Expand All @@ -168,14 +168,15 @@ jobs:
run: |
prNumber="${{ github.event.number }}"
commentsUrl="https://api.github.com/repos/Testably/Testably.Abstractions.FluentAssertions/issues/$prNumber/comments"
dashboardLink="attached Stryker dashboards on the build pipeline"
echo "Search for comment in PR#$prNumber containing $dashboardLink..."
mutationBadge="[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTestably%2FTestably.Abstractions.FluentAssertions%2F${GITHUB_HEAD_REF})](https://dashboard.stryker-mutator.io/reports/github.com/Testably/Testably.Abstractions.FluentAssertions/${GITHUB_HEAD_REF})"
dashboardLink="[Stryker.NET](https://stryker-mutator.io/docs/stryker-net/introduction/) mutation tested the changes in the pull request: \n$mutationBadge"
echo "Search for comment in PR#$prNumber containing $mutationBadge..."
result=$(curl -X GET $commentsUrl \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN")
if [[ $result != *"$dashboardLink"* ]]
if [[ $result != *"$mutationBadge"* ]]
then
body="{\"body\":\"Please check the attached Stryker dashboards on the build pipeline.\"}"
body="{\"body\":\"$dashboardLink\"}"
curl -X POST $commentsUrl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
Expand Down

0 comments on commit 3899f7c

Please sign in to comment.