From 731a6679cdf20d7c80337ff6857e833bc43876a8 Mon Sep 17 00:00:00 2001 From: Guillaume Lagorce Date: Tue, 17 Sep 2024 07:58:31 +0200 Subject: [PATCH] tech: use a Github Action to trigger CircleCI This will let us trigger build-and-test workflow on pull request only See https://circleci.com/blog/trigger-circleci-pipeline-github-action/ --- .circleci/config.yml | 18 ++++++++++++++++++ .github/workflows/trigger-ci.yaml | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/trigger-ci.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 902d67ad5a4..0dc34ad868a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,20 @@ version: 2.1 +parameters: + GHA_Actor: + type: string + default: '' + GHA_Action: + type: string + default: '' + GHA_Event: + type: string + default: '' + GHA_Meta: + type: string + default: '' + orbs: browser-tools: circleci/browser-tools@1.4.8 @@ -93,6 +107,10 @@ executors: workflows: version: 2 build-and-test: + # This workflow is set to be conditionally triggered, only when + # the GitHub Action is triggered. + # With no other workflows, normal push events will be ignored currently. + when: << pipeline.parameters.GHA_Action >> jobs: - checkout: context: Pix diff --git a/.github/workflows/trigger-ci.yaml b/.github/workflows/trigger-ci.yaml new file mode 100644 index 00000000000..6eeea8296d6 --- /dev/null +++ b/.github/workflows/trigger-ci.yaml @@ -0,0 +1,19 @@ +name: Trigger CircleCI + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + push: + branches: dev + +jobs: + trigger-ci: + runs-on: ubuntu-latest + + steps: + - name: Trigger CircleCI + # ensure PR is not draft + if: "! github.event.pull_request.draft" + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + env: + CCI_TOKEN: ${{ secrets.GUL_TEST_TRIGGER_CIIRCLECI_TOKEN }}