Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .fallout/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
"CodeCoverage",
"Compile",
"DotNetUnitTests",
"MutationComment",
"MutationTestPreparation",
"MutationTests",
"MutationTestsComment",
"MutationTestsDashboard",
"MutationTestsLinux",
"MutationTestsWindows",
"Pack",
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/ci-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "CI-Analysis"

on:
workflow_dispatch:
workflow_run:
workflows: [ "CI" ]
types:
- completed

jobs:
mutation-tests:
name: "Mutation tests"
# The mutation tests in the CI workflow are disabled, so there are no reports to publish.
if: false
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x
- name: Upload mutation dashboard and create comment
run: ./build.sh MutationTestsComment
# The artifacts of the workflow run are untrusted, because a pull request controls the code that
# produces them, so the build identifies the pull request by these values of the event alone.
env:
GithubToken: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
WorkflowRunId: ${{ github.event.workflow_run.id }}
WorkflowRunEvent: ${{ github.event.workflow_run.event }}
WorkflowRunHeadOwner: ${{ github.event.workflow_run.head_repository.owner.login }}
WorkflowRunHeadBranch: ${{ github.event.workflow_run.head_branch }}
WorkflowRunHeadSha: ${{ github.event.workflow_run.head_sha }}
56 changes: 30 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
Expand All @@ -33,7 +33,7 @@ jobs:
run: ./build.sh CodeCoverage
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ runner.os }}-artifacts
path: |
Expand All @@ -46,11 +46,11 @@ jobs:
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
Expand All @@ -61,7 +61,7 @@ jobs:
run: ./build.sh ApiChecks
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: API-tests
path: |
Expand All @@ -73,52 +73,56 @@ jobs:
if: false
runs-on: ubuntu-latest
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
DOTNET_NOLOGO: true
permissions:
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run mutation tests
run: ./build.sh MutationTestsLinux MutationComment
env:
GithubToken: ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh MutationTestsLinux
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: MutationTests-Linux
path: |
./Artifacts/*

mutation-tests-windows:
name: "Mutation tests (Windows)"
if: false
runs-on: windows-latest
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
DOTNET_NOLOGO: true
permissions:
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
10.0.x
- name: Run mutation tests
run: ./build.ps1 MutationTestsWindows MutationComment
env:
GithubToken: ${{ secrets.GITHUB_TOKEN }}
run: ./build.ps1 MutationTestsWindows
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: MutationTests-Windows
path: |
./Artifacts/*

static-code-analysis:
name: "Static code analysis"
Expand All @@ -129,11 +133,11 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
6.0.x
Expand All @@ -153,11 +157,11 @@ jobs:
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2
uses: EnricoMi/publish-unit-test-result-action@7622c5bf3d112a72ab4fa3951c2aa5723d8ab92d # v2.25.0
with:
comment_mode: always
files: "artifacts/**/**/*.trx"
2 changes: 1 addition & 1 deletion .github/workflows/notify-docs-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Dispatch extension-documentation-updated-event to Testably/Testably.Site
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ secrets.SITE_DISPATCH_TOKEN }}
repository: Testably/Testably.Site
Expand Down
2 changes: 1 addition & 1 deletion Pipeline/Build.CodeAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ partial class Build
.SetOrganization("testably")
.SetProjectKey("Testably_Testably.Abstractions")
.AddVSTestReports(TestResultsDirectory / "*.trx")
.AddOpenCoverPaths(TestResultsDirectory / "reports" / "OpenCover.xml")
.AddGenericCoveragePaths(TestResultsDirectory / "reports" / "SonarQube.xml")
.SetPullRequestOrBranchName(GitHubActions, BranchName)
.SetVersion(SemVer)
.SetToken(SonarToken));
Expand Down
6 changes: 4 additions & 2 deletions Pipeline/Build.CodeCoverage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ partial class Build
{
ReportGenerator(s => s
.SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll",
framework: "net8.0"))
framework: "net10.0"))
.SetTargetDirectory(TestResultsDirectory / "reports")
.AddReports(TestResultsDirectory / "**/*.cobertura.xml")
.AddReportTypes(ReportTypes.OpenCover)
// The generic format of Sonar lists the lines per file. A format that lists them per method leaves out the
// lines of a lambda in a generic class, because ReportGenerator keeps them in a class without methods.
.AddReportTypes(ReportTypes.SonarQube)
.AddFileFilters("-*.g.cs")
.SetAssemblyFilters("+Testably*"));
});
Expand Down
12 changes: 10 additions & 2 deletions Pipeline/Build.Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using static Fallout.Common.Tools.DotNet.DotNetTasks;

// ReSharper disable AllUnderscoreLocalParameterName
Expand Down Expand Up @@ -53,12 +54,19 @@ partial class Build
}
else if (GitHubActions.Ref.StartsWith("refs/tags/", StringComparison.OrdinalIgnoreCase) == true)
{
if (!Regex.IsMatch(GitHubActions.Ref,
@"\Arefs/tags/(core/)?v\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?\z"))
{
Assert.Fail(
$"The tag '{GitHubActions.Ref["refs/tags/".Length..]}' is no valid release tag (expected 'v1.2.3' or 'core/v1.2.3', optionally with a pre-release suffix like '-pre.1')");
}

int preReleaseIndex = GitHubActions.Ref.IndexOf('-');
preRelease = preReleaseIndex > 0 ? GitHubActions.Ref[preReleaseIndex..] : "";
}

CoreVersion = AssemblyVersion.FromGitVersion(GitVersionTasks.GitVersion(s => s
.SetFramework("net8.0")
.SetFramework("net10.0")
.SetNoFetch(true)
.SetNoCache(true)
.DisableProcessOutputLogging()
Expand All @@ -67,7 +75,7 @@ partial class Build
.Result, preRelease);

GitVersion gitVersion = GitVersionTasks.GitVersion(s => s
.SetFramework("net8.0")
.SetFramework("net10.0")
.SetNoFetch(true)
.SetNoCache(true)
.DisableProcessOutputLogging()
Expand Down
Loading
Loading