From f69c23020bdaff5b37b348f2087dec88960b1314 Mon Sep 17 00:00:00 2001 From: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com> Date: Thu, 10 Jul 2025 11:29:57 +0100 Subject: [PATCH] Run integration tests when PR is being merged (#155) --- .github/workflows/dotnet-build-and-test.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 36c326855f..c8e29967c8 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -14,11 +14,6 @@ on: - '.github/workflows/dotnet-build-and-test.yml' merge_group: branches: ["main"] - push: - branches: ["main"] - paths: - - dotnet/** - - '.github/workflows/dotnet-build-and-test.yml' env: COVERAGE_THRESHOLD: 80 @@ -108,10 +103,10 @@ jobs: - name: Log event name and matrix integration-tests shell: bash - run: echo "The event name is ${{ github.event_name }} and the matrix integration-tests is ${{ matrix.integration-tests }}" + run: echo "github.event_name:${{ github.event_name }} matrix.integration-tests:${{ matrix.integration-tests }} github.event.action:${{ github.event.action }} github.event.pull_request.merged:${{ github.event.pull_request.merged }}" - name: Azure CLI Login - if: github.event_name != 'pull_request' && matrix.integration-tests + if: github.event.action == 'closed' && github.event.pull_request.merged == true && matrix.integration-tests uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -120,7 +115,7 @@ jobs: - name: Run Integration Tests shell: bash - if: github.event_name != 'pull_request' && matrix.integration-tests + if: github.event.action == 'closed' && github.event.pull_request.merged == true && matrix.integration-tests run: | export INTEGRATION_TEST_PROJECTS=$(find ./dotnet -type f -name "*IntegrationTests.csproj" | tr '\n' ' ') for project in $INTEGRATION_TEST_PROJECTS; do