From df119edb6eee89014dd9d543032e5ff28fce5937 Mon Sep 17 00:00:00 2001 From: Nils Gruson Date: Wed, 8 Nov 2023 20:37:34 +0100 Subject: [PATCH] Added workflow to build examples separately --- .github/workflows/examples.yml | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/examples.yml diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 00000000000..c1465a85933 --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,75 @@ +name: Build examples + +on: + push: + branches: [ 'main*' ] + paths: + - 'examples/**' + pull_request: + branches: [ 'main*' ] + paths: + - 'examples/**' + +jobs: + + build-test-stable: + defaults: + run: + working-directory: examples + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + os: [ windows-latest, ubuntu-latest ] + version: [ net462, net6.0, net7.0, net8.0 ] + exclude: + - os: ubuntu-latest + version: net462 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetching all + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=false + + - name: Test ${{ matrix.version }} + run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed" + + build-test-experimental: + defaults: + run: + working-directory: examples + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + os: [ windows-latest, ubuntu-latest ] + version: [ net462, net6.0, net7.0, net8.0 ] + exclude: + - os: ubuntu-latest + version: net462 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetching all + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=true + + - name: Test ${{ matrix.version }} + run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed"