From 65edf14f6c719cda2ee323766b47b6bbdaab5854 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 28 Apr 2023 10:46:41 +0200 Subject: [PATCH 1/2] ci: Fix checks for merge queues We now exclude testing the branches `gh-readonly-queue/**` as these are the pushes GitHub does when "adding" PRs to a merge queue. We only want to test the merge commit of a queue, to make sure all PRs included in that merge play well together. With this we can also remove the (wrong) hacky `if` conditions in `test-generate-docs` and `publish-docs`. Signed-off-by: Leandro Lucarella --- .github/workflows/ci.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d88dea478..e1df7c5d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,16 @@ name: frequenz-sdk-python -on: [merge_group, pull_request, push, workflow_dispatch] +on: + merge_group: + pull_request: + push: + branches-ignore: + # Ignore pushes to merge queues. + # We only want to test the merge commit (`merge_group` event), the hashes + # in the push were already tested by the PR checks + - 'gh-readonly-queue/**' + workflow_dispatch: + jobs: test: @@ -68,9 +78,7 @@ jobs: if-no-files-found: error test-generate-docs: - # This could be github.event_name != 'push', but that's not being triggered - # for merge_group for some reason - if: github.event_name == 'pull_request' || github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' + if: github.event_name != 'push' runs-on: ubuntu-20.04 steps: - name: DEBUG INFO @@ -109,8 +117,7 @@ jobs: publish-docs: needs: ["test", "build-dist"] - # We shouldn't need the reference name here, but `merge_group` is being executed as if it was `push` - if: github.event_name == 'push' && (github.ref == 'refs/heads/v0.x.x' || startsWith(github.ref, 'refs/tags/')) + if: github.event_name == 'push' runs-on: ubuntu-20.04 permissions: contents: write From a0d63cfd0ede79d736be6fd0d27b33c1c836608b Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 28 Apr 2023 12:26:35 +0200 Subject: [PATCH 2/2] ci: Remove debug step Signed-off-by: Leandro Lucarella --- .github/workflows/ci.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e1df7c5d2..4f017b502 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,10 +81,6 @@ jobs: if: github.event_name != 'push' runs-on: ubuntu-20.04 steps: - - name: DEBUG INFO - env: - GITHUB_EVENT_NAME: ${{ github.event_name }} - run: echo $GITHUB_EVENT_NAME - name: Fetch sources uses: actions/checkout@v3