Skip to content

[test] Trigger CircleCI tests from PRs #36026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: v5.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ parameters:
description: The base url for running end-to-end test
type: string
default: ''
# parameters coming when triggered from GitHub action
GHA_Actor:
type: string
default: ''
GHA_Action:
type: string
default: ''
GHA_Event:
type: string
default: ''
GHA_Meta:
type: string
default: ''

defaults: &defaults
parameters:
Expand Down Expand Up @@ -797,7 +810,9 @@ workflows:

bundling:
when:
equal: [bundling, << pipeline.parameters.workflow >>]
or:
- equal: [bundling, << pipeline.parameters.workflow >>]
- equal: ['workflow:bundling', '<< pipeline.parameters.GHA_Meta >>']
jobs:
- test_bundling_prepare
- test_bundling_node-esm:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/bundling-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Bundling tests

on: pull_request

permissions: read-all

jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
- name: Start CircleCI bundling tests
uses: CircleCI-Public/[email protected]
env:
CCI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}
with:
GHA_Meta: 'workflow:bundling'
Comment on lines +1 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this GitHub action?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying out different things. I was working on an action that would trigger a CircleCI build only on some branches (release/*, not enabled here right now). But I learned this isn't possible as there's no access to secrets when running actions triggered from PRs. I'll look for another approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be possible to configure it with CircleCI yaml.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK CircleCI doesn't know the original branch name the PR is coming from