RSA Encryption #86
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: Unit Tests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| env: | |
| DOTNET_VERSION: '8.0.x' | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, macOS-latest, windows-latest ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore Dependencies | |
| run: dotnet restore | |
| - name: Restore Dotnet Tools | |
| run: dotnet tool restore | |
| - name: Build Project | |
| run: > | |
| dotnet build ./AdvancedSystems.Security | |
| --configuration Release | |
| --no-restore | |
| /warnAsError | |
| - name: Import AdvancedSystems Certificate Authority | |
| run: > | |
| dotnet certificate-tool add --file ./development/AdvancedSystems-CA.pfx | |
| --store-name My | |
| --store-location CurrentUser | |
| --password '${{ secrets.ADV_CA_SECRET }}' | |
| - name: Import Password Certificate (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| $AppSettings = Get-Content '.\AdvancedSystems.Security.Tests\appsettings.json' -Raw | ConvertFrom-Json | |
| $Name = $AppSettings.CertificateStore.Name | |
| $Location = $AppSettings.CertificateStore.Location | |
| Import-Certificate -FilePath .\development\AdvancedSystems-PasswordCertificate.pem -CertStoreLocation "Cert:\$Location\$Name" | |
| shell: powershell | |
| - name: Import Password Certificate (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| appSettings='./AdvancedSystems.Security.Tests/appsettings.json' | |
| name=$(jq -r '.CertificateStore.Name' $appSettings) | |
| location=$(jq -r '.CertificateStore.Location' $appSettings) | |
| dotnet certificate-tool add --file ./development/AdvancedSystems-PasswordCertificate.pem --store-name $name --store-location $location | |
| - name: Import Password Certificate (MacOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| appSettings='./AdvancedSystems.Security.Tests/appsettings.json' | |
| name=$(jq -r '.CertificateStore.Name' $appSettings) | |
| location=$(jq -r '.CertificateStore.Location' $appSettings) | |
| dotnet certificate-tool add --file ./development/AdvancedSystems-PasswordCertificate.pem --store-name $name --store-location $location | |
| - name: Configure DotNet User Secrets | |
| run: | | |
| dotnet user-secrets set CertificatePassword '${{ secrets.ADV_CA_SECRET }}' --project ./AdvancedSystems.Security.Tests | |
| - name: Run Unit Tests | |
| run: > | |
| dotnet test ./AdvancedSystems.Security.Tests | |
| --configuration Release | |
| --verbosity normal |