From 936822a181169cc08db444aefdb4f0bb30a59dd6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 30 Nov 2023 14:57:38 +0100 Subject: [PATCH] Import demo --- .github/workflows/ci.yml | 20 +++++++++++++++ .github/workflows/create-pr.yml | 40 ++++++++++++++++++++++++++++++ .mergify.yml | 44 +++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/create-pr.yml create mode 100644 .mergify.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..91fab3b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: Continuous Integration +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + sleep 30 + + test-before-merge: + # Only run this job on branches created by Mergify merge queue + if: startsWith(github.head_ref, 'mergify/merge-queue/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + sleep 60 diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml new file mode 100644 index 0000000..6b20295 --- /dev/null +++ b/.github/workflows/create-pr.yml @@ -0,0 +1,40 @@ +name: Create Pull Requests +on: + workflow_dispatch: + inputs: + autoqueue: + description: Whether to put the PR in queue automatically + type: boolean + +jobs: + create-hotfix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + mkdir testbed + echo `uuidgen` > testbed/`uuidgen` + - name: Create the hotfix pull request (autoqueue) + if: ${{ inputs.autoqueue }} + uses: peter-evans/create-pull-request@v5 + with: + title: "Hotfix pull request" + body: > + This is a test pull request! + commit-message: > + Testing 123 + branch: + labels: hotfix,autoqueue + base: main + - name: Create the hotfix pull request (autoqueue) + if: ${{ ! inputs.autoqueue }} + uses: peter-evans/create-pull-request@v5 + with: + title: "Hotfix pull request" + body: > + This is a test pull request! + commit-message: > + Testing 123 + branch: + labels: hotfix + base: main diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..a206fb6 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,44 @@ +pull_request_rules: + # If you add the label `automerge` on a PR, it will be merged automatically + - name: automatic merge + conditions: + - label = automerge + actions: + merge: + method: merge + + # If you add the label `automerge` on a PR, it will be queued automatically + - name: automatic queue + conditions: + - label = autoqueue + actions: + queue: + +queue_rules: + - name: hotfix + speculative_checks: 5 + allow_inplace_checks: false + queue_conditions: + - label = hotfix + # This can be queued without passing the CI + # But we still required to pass before merging + merge_conditions: + - check-success = test + - check-success = test-before-merge + + - name: default + queue_conditions: + - label != lowprio + - label != hotfix + - check-success = test + merge_conditions: + - check-success = test-before-merge + + - name: lowprio + batch_size: 3 + batch_max_wait_time: 1 min + queue_conditions: + - label = lowprio + - check-success = test + merge_conditions: + - check-success = test-before-merge