Add support for SHA256 and SHA512 algorithms in One Time Password generation #344
Workflow file for this run
This file contains hidden or 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, test (Pull Request) | |
on: | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout Code | |
- name: Install additional .NET SDKs | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore NuGet Packages | |
run: dotnet restore | |
- name: Build library | |
run: dotnet build -c Release --no-restore | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Compiled project | |
path: ${{ github.workspace }} | |
test: | |
needs: build | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
dotnet-framework: | |
- { name: ".NET Framework 4.6.2", framework: "net462", coverage: false, no-build: true, sdk: "8.0.x" } | |
- { name: ".NET Core 2.1", framework: "netcoreapp2.1", coverage: true, no-build: false, sdk: "2.1.x" } | |
- { name: ".NET Core 3.1", framework: "netcoreapp3.1", coverage: true, no-build: true, sdk: "3.1.x" } | |
- { name: ".NET 5.0", framework: "net5.0", coverage: true, no-build: true, sdk: "5.0.x" } | |
- { name: ".NET 5.0 Windows", framework: "net5.0-windows", coverage: true, no-build: true, sdk: "5.0.x" } | |
- { name: ".NET 6.0", framework: "net6.0", coverage: true, no-build: true, sdk: "6.0.x" } | |
- { name: ".NET 6.0 Windows", framework: "net6.0-windows", coverage: true, no-build: true, sdk: "6.0.x" } | |
name: Test ${{ matrix.dotnet-framework.name }} | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: Compiled project | |
path: ${{ github.workspace }} | |
- name: Install .NET SDK ${{ matrix.dotnet-framework.sdk }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-framework.sdk }} | |
- name: Run tests for ${{ matrix.dotnet-framework.name }} | |
working-directory: QRCoderTests | |
run: | | |
$coverage = if ("${{ matrix.dotnet-framework.coverage }}" -eq "true") { "/p:CollectCoverage=true /p:CoverletOutputFormat=opencover" } else { "" } | |
$noBuild = if ("${{ matrix.dotnet-framework.no-build }}" -eq "true") { "--no-build" } else { "" } | |
dotnet test -c Release -f ${{ matrix.dotnet-framework.framework }} --nologo $noBuild $coverage | |
additional-tests: | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: Compiled project | |
path: ${{ github.workspace }} | |
- name: Install additional .NET SDKs | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Run trim analysis | |
working-directory: QRCoderTrimAnalysis | |
run: dotnet publish -c Release -o bin/publish | |
- name: Run API approval tests | |
working-directory: QRCoderApiTests | |
run: dotnet test -c Release --nologo --no-build | |
clean: | |
needs: [build, test, additional-tests] | |
if: always() | |
runs-on: windows-latest | |
steps: | |
- name: Delete artifacts | |
uses: GeekyEggo/delete-artifact@v5 | |
with: | |
name: Compiled project |