diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index d51b7831..6afa7347 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -8,16 +8,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