From b064e588465f8a54586b0c50faa5a652f65cd9a4 Mon Sep 17 00:00:00 2001 From: Alessio Franceschelli Date: Fri, 19 Jan 2024 14:17:48 +0000 Subject: [PATCH] Upload test artifacts and add check for do-not-merge label --- .github/workflows/build.yml | 17 +++++++++++------ .github/workflows/labels.yml | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/labels.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f53e8cd..6b148bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v3 with: @@ -25,16 +25,21 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: 8.0.x - name: Build - run: dotnet build + run: dotnet build --no-incremental - name: Test - run: dotnet test --no-build --verbosity normal - + run: dotnet test --no-build --verbosity normal --logger trx --results-directory "TestResults" + - name: Upload test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results + path: TestResults + if: ${{ always() }} pack: runs-on: ubuntu-latest needs: @@ -43,7 +48,7 @@ jobs: if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v3 with: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..0df762a --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,18 @@ +name: Check PR Labels + +on: + pull_request: + types: + - opened + - labeled + - unlabeled + +jobs: + check_labels: + runs-on: ubuntu-latest + steps: + - name: Check for "do-not-merge" label + if: contains(github.event.pull_request.labels.*.name, 'do-not-merge') + run: | + echo "This PR should not be merged." + exit 1