Skip to content

Commit 1cf0cb9

Browse files
author
Vincent Li
committed
updates
1 parent d861306 commit 1cf0cb9

2 files changed

Lines changed: 48 additions & 18 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI Smoketest Dispatch
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "Branch or tag to run smoketest from"
8+
required: false
9+
default: "ci_test"
10+
type: string
11+
12+
jobs:
13+
prepare:
14+
name: Generate smoketest matrix from config
15+
runs-on: ubuntu-latest
16+
outputs:
17+
matrix_json_for_smoketest: ${{ steps.generate.outputs.matrix_json_for_smoketest }}
18+
job_types_with_jobs: ${{ steps.generate.outputs.job_types_with_jobs }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ inputs.ref }}
24+
submodules: recursive
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: Install converter dependency
32+
run: pip install pyyaml
33+
34+
- name: Convert .ci/config.yaml to matrix JSON (by job type)
35+
id: generate
36+
run: python .ci/scripts/config_to_matrix.py --config .ci/config.yaml --write-github-outputs
37+
38+
- name: Show generated job types
39+
run: |
40+
echo "job_types_with_jobs=${{ steps.generate.outputs.job_types_with_jobs }}"
41+
42+
run-child-smoketest:
43+
name: Execute smoketest child pipeline
44+
needs: prepare
45+
if: contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'smoketest')
46+
uses: ./.github/workflows/ci_child_for_smoketest.yml
47+
with:
48+
matrix_json: ${{ needs.prepare.outputs.matrix_json_for_smoketest }}

.github/workflows/ci_test.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,13 @@ on:
55
branches: ["ci_test"]
66
pull_request:
77
branches: ["ci_test"]
8-
workflow_dispatch:
9-
inputs:
10-
run_smoketest:
11-
description: "Run smoketest child pipeline (self-hosted)"
12-
type: boolean
13-
default: false
148

159
jobs:
1610
prepare:
1711
name: Generate matrix from config
1812
runs-on: ubuntu-latest
1913
outputs:
2014
matrix_json_for_unittest: ${{ steps.generate.outputs.matrix_json_for_unittest }}
21-
matrix_json_for_smoketest: ${{ steps.generate.outputs.matrix_json_for_smoketest }}
2215
job_types_with_jobs: ${{ steps.generate.outputs.job_types_with_jobs }}
2316
steps:
2417
- name: Checkout
@@ -49,14 +42,3 @@ jobs:
4942
uses: ./.github/workflows/ci_child_for_unittest.yml
5043
with:
5144
matrix_json: ${{ needs.prepare.outputs.matrix_json_for_unittest }}
52-
53-
run-child-smoketest:
54-
name: Execute smoketest child pipeline (manual)
55-
needs: prepare
56-
if: |
57-
github.event_name == 'workflow_dispatch' &&
58-
inputs.run_smoketest &&
59-
contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'smoketest')
60-
uses: ./.github/workflows/ci_child_for_smoketest.yml
61-
with:
62-
matrix_json: ${{ needs.prepare.outputs.matrix_json_for_smoketest }}

0 commit comments

Comments
 (0)