Skip to content

Commit 1712396

Browse files
authored
Update determine runner workflow to use large runners if the branch name matches the rc branching format (#846)
**Context:** This PR introduces a change to the CI, where a PR that matches the naming format of the RC branches (eg: `vX.Y.Z-rcN`) is automatically on-boarded to use large runner queue *without the usage of a label* **Description of the Change:** This change has been introduced within pennylane-lightning with the following two PRs: - PennyLaneAI/pennylane-lightning#769 - PennyLaneAI/pennylane-lightning#774 **Benefits:** Lower wait times for rc branch builds **Possible Drawbacks:** As noted in the lightning PRs, though the runners have parity, it is possible for a workflow to fail on the larger runners. The `urgent` label will be added to this PR to ensure jobs pass. **Related GitHub Issues:**
1 parent 56468af commit 1712396

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/determine-workflow-runner.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,17 @@ jobs:
3333
if: >-
3434
${{
3535
github.event_name == 'pull_request'
36-
&& contains(github.event.pull_request.labels.*.name, 'urgent')
3736
&& startsWith(inputs.default_runner, 'ubuntu')
3837
}}
3938
id: runner_group
40-
run: echo "runner_group=$LARGE_RUNNER_GROUP_NAME" >> $GITHUB_OUTPUT
39+
env:
40+
# We are not able to use \d to check numeric values as bash does not allow them (not POSIX compliant)
41+
RC_BRANCH_FORMAT_REGEX: v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]?
42+
REPO_FULL_NAME: PennyLaneAI/catalyst
43+
run: |
44+
if [[ '${{ contains(github.event.pull_request.labels.*.name, 'urgent') }}' == 'true' || ('${{ github.event.pull_request.head.repo.full_name }}' == "$REPO_FULL_NAME" && '${{ github.event.pull_request.head.ref }}' =~ $RC_BRANCH_FORMAT_REGEX) ]]; then
45+
echo "This job requires usage of the large runner group '$LARGE_RUNNER_GROUP_NAME'";
46+
echo "runner_group=$LARGE_RUNNER_GROUP_NAME" >> $GITHUB_OUTPUT
47+
else
48+
echo "This job does not require usage of large runners ...";
49+
fi

0 commit comments

Comments
 (0)