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
2 changes: 2 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
validate:
name: Validate job
uses: ./.github/workflows/validate-task.yml
# Thread CODECOV_TOKEN through so the unit-test job can upload coverage.
secrets: inherit
Comment thread
ptr727 marked this conversation as resolved.

# Build, version, validate, push, and release the triggering branch. Grants the write scopes
# build-release-task needs (it declares none, so the read-only smoke caller is not forced to over-grant).
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
name: Validate job
if: ${{ !github.event.deleted }}
uses: ./.github/workflows/validate-task.yml
# Thread CODECOV_TOKEN through so the unit-test job can upload coverage.
secrets: inherit
Comment thread
ptr727 marked this conversation as resolved.

# Build and pack the library in its branch configuration to prove it ships, publishing nothing. Runs on
# every push, so a change to build-release-task is exercised head-resolved in the PR that makes it.
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/validate-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ jobs:
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

# Builds with TreatWarningsAsErrors, so analyzer and code-style warnings fail here.
# --collect drives coverlet.collector to emit Cobertura XML into ./coverage/<guid>/.
- name: Run unit tests step
run: dotnet test
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
Comment thread
ptr727 marked this conversation as resolved.

# Report-only: fail_ci_if_error is false so a Codecov hiccup or an absent token never fails the gate.
- name: Upload coverage to Codecov step
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
directory: ./coverage
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# The same checks the editor runs interactively, enforced in CI from the same config files: CSharpier
# formatting, dotnet format style (EditorConfig), markdownlint, cspell on the user-facing docs, and
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.300" />
<PackageVersion Include="Serilog" Version="4.3.1" />
Expand Down
4 changes: 4 additions & 0 deletions UtilitiesTests/UtilitiesTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Utilities\Utilities.csproj" />
Expand Down