-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runnng matrix strategy to test all platforms
- Loading branch information
1 parent
1c2b9dd
commit 2fcfe60
Showing
1 changed file
with
31 additions
and
9 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 |
---|---|---|
|
@@ -30,6 +30,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- develop | ||
paths: | ||
- '**.h' | ||
- '**.c' | ||
|
@@ -40,7 +41,11 @@ on: | |
|
||
jobs: | ||
test: | ||
runs-on: windows-2019 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-dotnet@v4 | ||
|
@@ -50,16 +55,34 @@ jobs: | |
- name: Add local NuGet repository | ||
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json" | ||
|
||
- name: Install OpenSSL and link for macOS | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
brew install openssl | ||
sudo mkdir /usr/local/lib | ||
sudo ln -s $(brew --prefix)/opt/openssl@3/lib/libcrypto.3.dylib /usr/local/lib/libcrypto.3.dylib | ||
sudo ln -s $(brew --prefix)/opt/openssl@3/lib/libssl.3.dylib /usr/local/lib/libssl.3.dylib | ||
- name: Install PCSC and link libUdev for Ubuntu | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update && sudo apt-get install pcscd -yq | ||
sudo ln -s /usr/lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/libudev.so | ||
- name: Restore dotnet dependencies | ||
run: | | ||
dotnet restore | ||
- name: Test Yubico.YubiKey | ||
run: dotnet test --configuration Release --nologo --logger trx --collect:"XPlat Code Coverage" Yubico.YubiKey/tests/unit/Yubico.YubiKey.UnitTests.csproj --settings coverlet.runsettings.xml | ||
run: dotnet test --no-restore --nologo --logger trx --collect:"XPlat Code Coverage" Yubico.YubiKey/tests/unit/Yubico.YubiKey.UnitTests.csproj --settings coverlet.runsettings.xml | ||
|
||
- name: Test Yubico.Core | ||
run: dotnet test --configuration Release --nologo --logger trx --collect:"XPlat Code Coverage" Yubico.Core/tests/Yubico.Core.UnitTests.csproj --settings coverlet.runsettings.xml | ||
run: dotnet test --no-restore --nologo --logger trx --collect:"XPlat Code Coverage" Yubico.Core/tests/Yubico.Core.UnitTests.csproj --settings coverlet.runsettings.xml | ||
|
||
- name: Upload Test Result Files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: TestResults | ||
name: TestResults-${{ matrix.os }} | ||
if-no-files-found: error | ||
path: '**/TestResults/*' | ||
|
||
|
@@ -68,9 +91,6 @@ jobs: | |
needs: test | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: TestResults | ||
path: ${{ github.workspace }} | ||
|
||
- name: Combine Coverage Reports # This is because one report is produced per project, and we want one result for all of them. | ||
uses: danielpalme/[email protected] | ||
|
@@ -110,6 +130,7 @@ jobs: | |
contents: read | ||
checks: write | ||
needs: coverage | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Download coverage results | ||
uses: actions/download-artifact@v4 | ||
|
@@ -121,7 +142,6 @@ jobs: | |
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/[email protected] | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
@@ -133,12 +153,14 @@ jobs: | |
contents: read | ||
checks: write | ||
needs: test | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
||
- name: run ls recursively | ||
run: ls -R | ||
|
||
- name: Add Test Results PR Comment | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
with: | ||
trx_files: "${{ github.workspace }}/**/*.trx" |