update packages #774
Workflow file for this run
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
name: Build and Test | |
on: | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
- 'SignNow.Net/SignNow.Net.Examples/**' | |
tags-ignore: | |
- '**' | |
pull_request: | |
branches: | |
- 'master' | |
- 'develop' | |
paths-ignore: | |
- '**.md' | |
tags-ignore: | |
- '**' | |
# Workflow | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Ubuntu | |
- { name: 'Linux .NET 5', os: ubuntu-22.04, framework: 'net5' } | |
# macOs | |
- { name: 'macOS .NET 5', os: macos-13, framework: 'net5' } | |
# Windows | |
- { name: 'Windows .NET Core 3', os: windows-latest, framework: 'netcoreapp3.1' } | |
- { name: 'Windows .NET 5', os: windows-latest, framework: 'net5' } | |
- { name: 'Windows .NET 4.5', os: windows-latest, framework: 'net45' } | |
env: | |
COREHOST_TRACE: false | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 # Disable sending usage data to Microsoft | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # prevent the caching of the packages on the build machine | |
DOTNET_NOLOGO: true # removes logo and telemetry message from first run of dotnet cli | |
NUGET_XMLDOC_MODE: skip # prevent the download of the XML documentation for the packages | |
COVERAGE_PATH: SignNow.Net.Test/bin/Debug | |
# Do not generate summary otherwise it leads to duplicate errors in build log | |
DOTNET_BUILD_ARGS: SignNow.Net --configuration Debug /consoleloggerparameters:NoSummary /property:GenerateFullPaths=true | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup .NET SDK Version for Target Framework | |
run: | | |
If ("${{ matrix.framework }}" -eq "netcoreapp3.1") { | |
Write-Output "DOTNET_SDK_VERSION=3.1.x" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
} ElseIf ("${{ matrix.framework }}" -eq "net5") { | |
Write-Output "DOTNET_SDK_VERSION=5.0.x" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
} | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | |
- name: Setup Nuget Cache | |
uses: actions/cache@v4 | |
id: nuget-cache | |
with: | |
path: ~/.nuget | |
key: ${{ runner.os }}-nuget-${{ matrix.framework }}-${{ hashFiles('**/*.csproj') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Setup dotnet tools | |
env: | |
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ env.DOTNET_SDK_VERSION }}/x64 | |
run: | | |
dotnet tool install --global InheritDocTool | |
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
- name: Restore Nuget packages | |
run: dotnet restore -v:n | |
- name: Configure signNow API | |
run: echo '${{ secrets.TEST_CREDITS_JSON }}' >> ${{ github.workspace }}/api-eval.signnow.com.json | |
- name: Build and Pack Solution | |
run: | | |
dotnet build ${{ env.DOTNET_BUILD_ARGS }} | |
dotnet pack --configuration Release --output ./SignNow.Net/bin/Publish SignNow.Net | |
- name: Run Tests on ${{ matrix.framework }} with Coverage | |
run: | | |
dotnet test SignNow.Net.Test ` | |
--configuration Debug --framework ${{ matrix.framework }} ` | |
/p:CollectCoverage=true | |
- name: Save Code Coverage Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CoverageReports-${{ runner.os }}-${{ matrix.framework }}.zip | |
path: SignNow.Net.Test/bin/Debug/**/coverage* | |
- name: Setup Code Coverage report flags | |
run: | | |
If ("${{ matrix.framework }}" -eq "netcoreapp3.1") { | |
Write-Output "TARGET_FRAMEWORK=netstandard12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
} ElseIf ("${{ matrix.framework }}" -eq "net5") { | |
Write-Output "TARGET_FRAMEWORK=netstandard20" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
} Else { | |
Write-Output "TARGET_FRAMEWORK=net45" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
} | |
- name: Test Release Notes parser | |
if: (runner.os == 'macOS' || runner.os == 'Linux') | |
shell: bash | |
run: | | |
.github/release-notes.sh CHANGELOG.md | |
- name: Upload Code Coverage Report (Codecov.io) | |
continue-on-error: true | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ runner.os }}-codecov-${{ matrix.framework }} | |
flags: ${{ runner.os }},${{ env.TARGET_FRAMEWORK }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{ env.COVERAGE_PATH }}/${{ matrix.framework }}/coverage.${{ matrix.framework }}.opencover.xml | |
fail_ci_if_error: false |