diff --git a/.github/workflows/ci-stryker.yml b/.github/workflows/ci-stryker.yml deleted file mode 100644 index 5f21202..0000000 --- a/.github/workflows/ci-stryker.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "CI (Stryker)" - -on: - workflow_dispatch: - -jobs: - 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ceb3fa2..4106f8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Testably.Abstractions.FluentAssertions.sln b/Testably.Abstractions.FluentAssertions.sln index 169fb6e..87d1337 100644 --- a/Testably.Abstractions.FluentAssertions.sln +++ b/Testably.Abstractions.FluentAssertions.sln @@ -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}"