From 9e00077602fc3f6ef2fee78b375a5bd3b6ec84b7 Mon Sep 17 00:00:00 2001 From: Donald Gray Date: Tue, 6 Aug 2024 16:18:14 +0100 Subject: [PATCH] Only run build + test for draft PRs --- .github/workflows/run_build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/run_build.yml b/.github/workflows/run_build.yml index 13dc7b6b6..bc8f6cf48 100644 --- a/.github/workflows/run_build.yml +++ b/.github/workflows/run_build.yml @@ -11,7 +11,33 @@ on: - "scripts/**" jobs: + # if this is for a draft PR, build + run tests only + test-dotnet-only: + if: github.event.pull_request.draft == true + runs-on: ubuntu-latest + defaults: + run: + working-directory: src/protagonist + env: + BUILD_CONFIG: "Release" + SOLUTION: "protagonist.sln" + steps: + - id: checkout + uses: actions/checkout@v4 + - id: setup-dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "6.0.x" + - id: restore-dotnet-dependencies + run: dotnet restore $SOLUTION + - id: build-dotnet + run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore + - id: test-dotnet + run: dotnet test $SOLUTION --filter 'Category!=Manual' --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal + + # if this is NOT a draft: build, test, sonar-scan and build images test-dotnet: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest defaults: run: