From 8da292ad2f7157fde4d35e7f55882c2216273298 Mon Sep 17 00:00:00 2001 From: Michael Croes Date: Mon, 24 Jul 2023 21:32:49 +0200 Subject: [PATCH] ci: Run tests against all target frameworks on all OS-es --- .github/workflows/dotnet.yml | 39 ++++++------------------------------ 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 433f5d2..72150f7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -72,47 +72,20 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-20.04, macos-latest] - test-framework: [net6.0, net7.0] - include: - - os: ubuntu-20.04 - test-framework: net6.0 - installSnap7: true - dotnet-sdk: '6.x' - - os: ubuntu-20.04 - test-framework: net7.0 - installSnap7: true - dotnet-sdk: '7.x' - - os: macos-latest - test-framework: net6.0 - installSnap7: true - dotnet-sdk: '6.x' - - os: macos-latest - test-framework: net7.0 - installSnap7: true - dotnet-sdk: '7.x' - - os: windows-latest - test-framework: net6.0 - dotnet-sdk: '6.x' - - os: windows-latest - test-framework: net7.0 - dotnet-sdk: '7.x' - - os: windows-latest - test-framework: net462 - dotnet-sdk: '7.x' fail-fast: false steps: - uses: actions/checkout@v2 - name: Install Snap7 Linux - if: ${{ matrix.installSnap7 && matrix.os == 'ubuntu-20.04' }} + if: ${{ matrix.os == 'ubuntu-20.04' }} run: | sudo add-apt-repository ppa:gijzelaar/snap7 sudo apt-get update sudo apt-get install libsnap7-1 libsnap7-dev - name: Install Snap7 MacOs - if: ${{ matrix.installSnap7 && matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'macos-latest' }} run: | brew install snap7 @@ -120,7 +93,7 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - ${{ matrix.dotnet-sdk }} + 6.x 7.x - name: Nuget Cache @@ -128,12 +101,12 @@ jobs: with: path: ~/.nuget/packages # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-${{ matrix.test-framework }}-nuget-${{ hashFiles('**/packages.lock.json') }} + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} restore-keys: | - ${{ runner.os }}-${{ matrix.test-framework }}-nuget + ${{ runner.os }}-nuget - name: Test - run: dotnet test --nologo --verbosity normal --logger GitHubActions --framework ${{ matrix.test-framework }} + run: dotnet test --nologo --verbosity normal --logger GitHubActions deploy: # Publish only when creating a GitHub Release