From 2497dd45690f54f3cb3320b8cfb919f164598e60 Mon Sep 17 00:00:00 2001 From: Austin Drenski Date: Mon, 22 Jan 2024 09:28:06 -0500 Subject: [PATCH] chore: Sync ci.yml with contrib repo Follows #173 and open-feature/dotnet-sdk-contrib#134 to synchronize ci.yml between both repos. ```console $ diff dotnet-sdk{,-contrib}/.github/workflows/ci.yml ``` Signed-off-by: Austin Drenski --- .github/workflows/ci.yml | 54 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca5f5083..1d2fd897 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: CI on: push: @@ -11,44 +11,41 @@ on: - '**.md' jobs: - unit-tests-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + build: + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 7.0.x - - - name: Run Tests - run: dotnet test test/OpenFeature.Tests/ --configuration Release --logger GitHubActions + runs-on: ${{ matrix.os }} - unit-tests-windows: - runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive - name: Setup .NET SDK uses: actions/setup-dotnet@v4 + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: dotnet-version: | 6.0.x 7.0.x + source-url: https://nuget.pkg.github.com/open-feature/index.json + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --no-restore - - name: Run Tests - run: dotnet test test\OpenFeature.Tests\ --configuration Release --logger GitHubActions + - name: Test + run: dotnet test --no-build --logger GitHubActions packaging: - needs: - - unit-tests-linux - - unit-tests-windows + needs: build permissions: contents: read @@ -57,14 +54,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive - name: Setup .NET SDK uses: actions/setup-dotnet@v4 + env: + NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: dotnet-version: | 6.0.x 7.0.x + source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Restore run: dotnet restore