-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a composite action to run module tests (#72)
* Introduce a composite action to run module tests * Treat Core as yet another module except creating NuGet package
- Loading branch information
1 parent
8dd1fe0
commit accc4da
Showing
7 changed files
with
94 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Test module | ||
description: Run tests against specified module | ||
inputs: | ||
module-name: | ||
description: Name of the module | ||
required: true | ||
module-namespace: | ||
description: Name of the module namespace | ||
required: true | ||
codecov-token: | ||
description: Value of Codecov token used to upload code coverage results | ||
required: true | ||
coverage-directory: | ||
description: Path to code coverage directory where results are being stored | ||
required: false | ||
default: ${{ github.workspace }}\src\opencover | ||
outputs: | ||
file-path: | ||
description: Signing key file path | ||
value: ${{ steps.signing-key.outputs.PATH }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: 🧪 test ${{ matrix.package_module }} in net7.0 & collect coverage | ||
id: module-code-coverage | ||
run: | | ||
$path = [IO.Path]::Combine("$env:CoverageDirectory","$env:ModuleFullName.xml") | ||
dotnet test ./src/$env:ModuleFullName.Tests/ --no-build -f $env:TargetFramework -e:CollectCoverage=true -e:CoverletOutputFormat=opencover -e:Exclude="[xunit*]*" -e:CoverletOutput=$path | ||
"FILE=$env:ModuleFullName.$env:TargetFramework.xml" >> $env:GITHUB_OUTPUT | ||
shell: pwsh | ||
env: | ||
CoverageDirectory: ${{ inputs.coverage-directory }} | ||
ModuleFullName: ${{ inputs.module-namespace }}.${{ inputs.module-name }} | ||
TargetFramework: net7.0 | ||
- name: 🧪 test ${{ matrix.package_module }} in net472 | ||
run: dotnet test ./src/${{ inputs.module-namespace }}.${{ inputs.module-name }}.Tests/ --no-build -f net472 | ||
shell: pwsh | ||
- name: 🧪 test ${{ matrix.package_module }} in net48 | ||
run: dotnet test ./src/${{ inputs.module-namespace }}.${{ inputs.module-name }}.Tests/ --no-build -f net48 | ||
shell: pwsh | ||
- name: 📤 upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ inputs.codecov-token }} | ||
files: ${{ steps.module-code-coverage.outputs.FILE }} | ||
directory: ${{ inputs.coverage-directory }} | ||
flags: unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.7.34202.233 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Objectivity.AutoFixture.XUnit2.Core", "Objectivity.AutoFixture.XUnit2.Core\Objectivity.AutoFixture.XUnit2.Core.csproj", "{A639D1F4-C3D5-499F-944B-DEE361C20082}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Objectivity.AutoFixture.XUnit2.Core.Tests", "Objectivity.AutoFixture.XUnit2.Core.Tests\Objectivity.AutoFixture.XUnit2.Core.Tests.csproj", "{D9095A71-49FC-47FE-8C49-1677EBE42B53}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{A639D1F4-C3D5-499F-944B-DEE361C20082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A639D1F4-C3D5-499F-944B-DEE361C20082}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A639D1F4-C3D5-499F-944B-DEE361C20082}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A639D1F4-C3D5-499F-944B-DEE361C20082}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D9095A71-49FC-47FE-8C49-1677EBE42B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D9095A71-49FC-47FE-8C49-1677EBE42B53}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D9095A71-49FC-47FE-8C49-1677EBE42B53}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D9095A71-49FC-47FE-8C49-1677EBE42B53}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {D092E697-BEB8-4A00-B37E-4109FD2B17E7} | ||
EndGlobalSection | ||
EndGlobal |