-
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.
Split build into build-and-test and pack
- Loading branch information
1 parent
5e74308
commit 5cefebc
Showing
2 changed files
with
53 additions
and
29 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 |
---|---|---|
@@ -1,47 +1,42 @@ | ||
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 | ||
module-name: | ||
description: Name of the module | ||
required: true | ||
module-namespace: | ||
description: Name of the module namespace | ||
required: true | ||
target-framework: | ||
description: Framework version to run tests against | ||
required: true | ||
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 | ||
- name: 🧪 test ${{ inputs.module-name }} in ${{ inputs.target-framework }} & collect coverage | ||
id: test-and-collect-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 | ||
$path = [IO.Path]::Combine("${{ inputs.coverage-directory }}","$env:ModuleFullName.xml") | ||
dotnet test ./src/$env:ModuleFullName.Tests/ --no-build -f ${{ inputs.target-framework }} -e:CollectCoverage=true -e:CoverletOutputFormat=opencover -e:Exclude="[xunit*]*" -e:CoverletOutput=$path | ||
"FILE=$env:ModuleFullName.${{ inputs.target-framework }}.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 }} | ||
files: ${{ steps.test-and-collect-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