From 28e69ab2e7d46c9911f91ab68506a3b5b2645098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 10 Jul 2024 07:47:30 +0200 Subject: [PATCH] build: run samples on both .NET 6 and 8 --- .github/workflows/samples.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index b4eac0ff..3cf85799 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -7,16 +7,26 @@ on: jobs: run-samples: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dotnet: [ "6.0", "8.0" ] steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 6.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Run samples - working-directory: ./Google.Cloud.EntityFrameworkCore.Spanner.Samples - run: dotnet run All + - uses: actions/checkout@v4 + - name: Setup .NET + id: setup + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{matrix.dotnet}}.x + - name: Create global.json file + run: "echo '{\"sdk\":{\"version\": \"${{ steps.setup.outputs.dotnet-version }}\"}}' > ./global.json" + - run: dotnet --version + - name: Restore dependencies + working-directory: ./Google.Cloud.EntityFrameworkCore.Spanner.Samples + run: dotnet restore -p:TargetFramework=net${{ matrix.dotnet }} + - name: Build + run: dotnet build --no-restore --framework net${{ matrix.dotnet }} + working-directory: ./Google.Cloud.EntityFrameworkCore.Spanner.Samples + - name: Run samples + working-directory: ./Google.Cloud.EntityFrameworkCore.Spanner.Samples + run: dotnet run --no-build --framework net${{ matrix.dotnet }} All