diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d09a5d9458b8..1664a5be0bdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,7 @@ name: Build on: - push: - pull_request: - types: [opened, synchronize, reopened, edited] + workflow_call: permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index ef6840be173f..fcf7ef3a03e8 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -3,12 +3,7 @@ name: Changelog on: - push: - branches: - - "main" - - "[0-9].[0-9]" - paths: - - "CHANGELOG.md" + workflow_call: permissions: {} jobs: diff --git a/.github/workflows/build-checks.yml b/.github/workflows/checks.yml similarity index 98% rename from .github/workflows/build-checks.yml rename to .github/workflows/checks.yml index f9fc85a33619..ec4795d7c60c 100644 --- a/.github/workflows/build-checks.yml +++ b/.github/workflows/checks.yml @@ -3,9 +3,7 @@ name: build-checks on: - push: - pull_request: - types: [opened, synchronize, reopened, edited] + workflow_call: permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/git.yaml b/.github/workflows/git.yml similarity index 90% rename from .github/workflows/git.yaml rename to .github/workflows/git.yml index a2b94fa7106b..abe4ba803b7c 100644 --- a/.github/workflows/git.yaml +++ b/.github/workflows/git.yml @@ -1,6 +1,7 @@ name: Git Checks -on: [pull_request] +on: + workflow_call: jobs: block-fixup: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 622f04aa5e46..aa75be8787d8 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -3,8 +3,7 @@ name: pre-commit on: - push: - pull_request: + workflow_call: permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000000..3be26454ed91 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,36 @@ +name: Pull request + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - edited + +jobs: + pre-commit: + uses: ./.github/workflows/pre-commit.yml + + checks: + uses: ./.github/workflows/checks.yml + + git: + uses: ./.github/workflows/git.yml + + build: + uses: ./.github/workflows/build.yml + + # This task is used as a probe for auto merge + # In the future, it could also be used to perform a status update (e.g once the whole CI is passing + is ready for review, add a specific label such as `need review`) + ready: + name: Ready to merge + needs: + - pre-commit + - checks + - git + - build + runs-on: ubuntu-latest + steps: + - name: Ready to go + run: "exit 0" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..433ce0a339b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + push: + branches: + - main + - "[0-9].[0-9]" + workflow_dispatch: + +jobs: + checks: + uses: ./.github/workflows/checks.yml + + changelog: + uses: ./.github/workflows/changelog.yml + + build: + uses: ./.github/workflows/build.yml + + sync: + if: ${{ github.ref != 'refs/heads/main' }} + uses: ./.github/workflows/sync_branch.yml diff --git a/.github/workflows/sync_branches.yml b/.github/workflows/sync_branches.yml index 7db85af239a9..48c4ae30a017 100644 --- a/.github/workflows/sync_branches.yml +++ b/.github/workflows/sync_branches.yml @@ -1,9 +1,6 @@ name: Sync Branches on: - push: - branches: - - "2.5" - - "2.6" + workflow_call: workflow_dispatch: permissions: {}