Skip to content

Commit c27f4f3

Browse files
committed
Extract PR test to a single workflow
1 parent 42eb06d commit c27f4f3

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/scripts/extract_matrix.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
"GITHUB_CI": "true"
1919
}
2020

21-
PR_JOBS='^(?=.*python)(?!.*(retagger|dsl)).*$'
22-
2321
# If any of these terms are in the job json, they do not run in public
2422
# infrastructure
2523
JOB_EXCLUSION_TERMS = (
@@ -295,8 +293,6 @@ def get_tagged_jobs(buildspec, target, filter=None):
295293

296294

297295
def main(jsonnet_bin, ci_jsonnet, target, filter=None, indent=False):
298-
if not filter: filter = PR_JOBS
299-
300296
result = subprocess.check_output([jsonnet_bin, ci_jsonnet], text=True)
301297
buildspec = json.loads(result)
302298
tagged_jobs = get_tagged_jobs(buildspec, target, filter=filter)

.github/workflows/ci-matrix-gen.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ on:
1212
jobs_to_run:
1313
required: true
1414
type: string
15-
pull_request:
16-
types: [review_requested, ready_for_review]
1715
schedule:
1816
- cron: '0 0 * * 1'
1917

@@ -24,7 +22,7 @@ jobs:
2422
matrix: ${{ steps.set-matrix.outputs.matrix }}
2523
env:
2624
TARGET: tier1
27-
JOBS: ${{ inputs.jobs_to_run || (github.event_name == 'schedule' && 'python-svm-build-gate-linux|python-unittest-retagger|python-unittest-retagger-merge') || ''}}
25+
JOBS: ${{ inputs.jobs_to_run }}
2826
steps: &generate_matrix
2927
- uses: actions/checkout@v4
3028
- name: Download sjsonnet

.github/workflows/ci-unittests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run CI unittests
2+
on:
3+
pull_request:
4+
types: [review_requested, ready_for_review]
5+
workflow_dispatch:
6+
7+
jobs:
8+
run-retagger:
9+
uses: ./.github/workflows/ci-matrix-gen.yml
10+
with:
11+
jobs_to_run: ^(?=.*python)(?!.*(retagger|dsl)).*$

0 commit comments

Comments
 (0)