Skip to content

workflows

workflows #2

name: PR Tests - Windows
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dotnet-version: 6.0
tfm: net6.0
- dotnet-version: 7.0
tfm: net7.0
- dotnet-version: 8.0
tfm: net8.0
- dotnet-version: 9.0
tfm: net9.0
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore (test project only, pinned TF)
run: |
echo "Restoring test project for framework ${{ matrix.tfm }}"
dotnet restore ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj --framework ${{ matrix.tfm }}
- name: Build (override framework)
run: |
echo "Building solution for framework ${{ matrix.tfm }}"
dotnet build ./cas-dotnet-sdk.sln -c Release --no-restore -f ${{ matrix.tfm }}
- name: Run tests (override framework)
run: |
echo "Running tests for framework ${{ matrix.tfm }}"
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --no-build -f ${{ matrix.tfm }} --logger "trx"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: TestResults-dotnet-${{ matrix.dotnet-version }}
path: |
**/TestResults/*.trx
**/*.trx