From 41d15143c418c601b81054d2cf65d412b52778d1 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 27 Apr 2023 09:50:24 +0200 Subject: [PATCH 1/4] Add a dummy workflow to succeed DCO check on merge queues See https://github.com/frequenz-floss/frequenz-sdk-python/issues/363 for more details. Signed-off-by: Leandro Lucarella --- .github/workflows/dco-merge-queue.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/dco-merge-queue.yml diff --git a/.github/workflows/dco-merge-queue.yml b/.github/workflows/dco-merge-queue.yml new file mode 100644 index 000000000..d820e70c3 --- /dev/null +++ b/.github/workflows/dco-merge-queue.yml @@ -0,0 +1,11 @@ +# Based on https://github.com/hyperledger/besu/pull/5207/files +name: DCO +on: + merge_group: + +jobs: + dco: + runs-on: ubuntu-latest + if: ${{ github.actor != 'dependabot[bot]' }} + steps: + - run: echo "This DCO job runs on merge_queue event and doesn't check PR contents" From 0d4f1c5f931cfea7863ff9834abd9ec2bbdae0d6 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 27 Apr 2023 14:37:16 +0200 Subject: [PATCH 2/4] ci: Don't build docs only for push The `generate-docs-pr` should also run for `merge_group` (and also `workflow_dispatch`, why not?), so we change the `if` condition to only exclude `push`es. We also rename the job to `test-generate-docs` to make it more generic. Signed-off-by: Leandro Lucarella --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dc3bb322..c8a451ff4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,8 +67,8 @@ jobs: path: dist/ if-no-files-found: error - generate-docs-pr: - if: github.event_name == 'pull_request' + test-generate-docs: + if: github.event_name != 'push' runs-on: ubuntu-20.04 steps: - name: Fetch sources @@ -89,7 +89,7 @@ jobs: - name: Generate the documentation env: - MIKE_VERSION: pr-${{ github.event.number }} + MIKE_VERSION: gh-${{ github.job }} run: | mike deploy $MIKE_VERSION mike set-default $MIKE_VERSION From 358217876f4176d3fb6a7c4ae50da16f7d91343e Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 27 Apr 2023 15:24:11 +0200 Subject: [PATCH 3/4] WIP: trigger weirdness Signed-off-by: Leandro Lucarella --- .github/workflows/ci.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8a451ff4..d88dea478 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,9 +68,15 @@ jobs: if-no-files-found: error test-generate-docs: - if: github.event_name != 'push' + # 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' 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 @@ -103,7 +109,8 @@ jobs: publish-docs: needs: ["test", "build-dist"] - if: github.event_name == 'push' + # 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/')) runs-on: ubuntu-20.04 permissions: contents: write @@ -180,7 +187,7 @@ jobs: create-github-release: needs: ["publish-docs"] # Create a release only on tags creation - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') permissions: # We need write permissions on contents to create GitHub releases and on # discussions to create the release announcement in the discussion forums From ee2ac092d0ef455900b2bd09685cf2add21e89fd Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 27 Apr 2023 15:25:04 +0200 Subject: [PATCH 4/4] Rename DCO job Signed-off-by: Leandro Lucarella --- .github/workflows/dco-merge-queue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dco-merge-queue.yml b/.github/workflows/dco-merge-queue.yml index d820e70c3..fb1cd90c7 100644 --- a/.github/workflows/dco-merge-queue.yml +++ b/.github/workflows/dco-merge-queue.yml @@ -4,7 +4,7 @@ on: merge_group: jobs: - dco: + DCO: runs-on: ubuntu-latest if: ${{ github.actor != 'dependabot[bot]' }} steps: