Skip to content

Commit

Permalink
combine ci-stryker and ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
vbreuss committed Apr 1, 2024
1 parent a8a62af commit be5f48d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 63 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/ci-stryker.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,60 @@ jobs:
with:
name: Test results (.NET Framework)
path: TestResults

stryker:
name: Mutation testing
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
- name: Install .NET Stryker
shell: bash
run: |
dotnet tool install dotnet-stryker --tool-path ../tools
- name: Prepare Reports directory
shell: bash
run: |
mkdir Tests/StrykerOutput/Reports -p
- name: Analyze Testably.Abstractions.FluentAssertions
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
shell: bash
run: |
cd Tests
../../tools/dotnet-stryker -f ../.github/stryker/Stryker.Config.json -v "${GITHUB_HEAD_REF}" -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
with:
name: Stryker
path: Tests/StrykerOutput/Reports/*
- name: Add comment to pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
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..."
result=$(curl -X GET $commentsUrl \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN")
if [[ $result != *"$dashboardLink"* ]]
then
body="{\"body\":\"Please check the attached Stryker dashboards on the build pipeline.\"}"
curl -X POST $commentsUrl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "$body"
fi
2 changes: 1 addition & 1 deletion Testably.Abstractions.FluentAssertions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{8FD8E33B-2072-48CA-8164-DE2AA5DCB8FD}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\ci-stryker.yml = .github\workflows\ci-stryker.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\test-report.yml = .github\workflows\test-report.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testably.Abstractions.FluentAssertions", "Source\Testably.Abstractions.FluentAssertions\Testably.Abstractions.FluentAssertions.csproj", "{BC318ADF-0A23-4D0F-8FBE-4E73F839450A}"
Expand Down

0 comments on commit be5f48d

Please sign in to comment.