From 53a1291ffbb416cb83ccbbe7a50dc605fd4920bf 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 | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/trigger-ci.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 902d67ad5a4..ec471f04fdc 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..e83e808bab6 --- /dev/null +++ b/.github/workflows/trigger-ci.yaml @@ -0,0 +1,15 @@ +name: Trigger CircleCI + +on: + pull_request: + types: [opened, reopened] + +jobs: + trigger-ci: + runs-on: ubuntu-latest + + steps: + - name: Trigger CircleCI + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + env: + CCI_TOKEN: ${{ secrets.PIX_SERVICE_ACTIONS_TOKEN }}