|
| 1 | +name: Scheduled CI Parent Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "33 15 * * *" # 每天 UTC 02:00 |
| 6 | + workflow_dispatch: # 可选:支持手动触发 |
| 7 | + |
| 8 | +jobs: |
| 9 | + prepare: |
| 10 | + name: Generate matrix from config |
| 11 | + runs-on: ubuntu-latest |
| 12 | + outputs: |
| 13 | + matrix_json_for_unittest: ${{ steps.generate.outputs.matrix_json_for_unittest }} |
| 14 | + matrix_json_for_smoketest: ${{ steps.generate.outputs.matrix_json_for_smoketest }} |
| 15 | + matrix_json_for_performancetest: ${{ steps.generate.outputs.matrix_json_for_performancetest }} |
| 16 | + job_types_with_jobs: ${{ steps.generate.outputs.job_types_with_jobs }} |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + submodules: recursive |
| 22 | + |
| 23 | + - name: Setup Python |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: "3.11" |
| 27 | + |
| 28 | + - name: Install converter dependency |
| 29 | + run: pip install pyyaml |
| 30 | + |
| 31 | + - name: Convert .ci/config.yaml to matrix JSON (by job type) |
| 32 | + id: generate |
| 33 | + run: python .ci/scripts/config_to_matrix.py --config .ci/config.yaml --write-github-outputs |
| 34 | + |
| 35 | + - name: Show generated job types |
| 36 | + run: | |
| 37 | + echo "job_types_with_jobs=${{ steps.generate.outputs.job_types_with_jobs }}" |
| 38 | + echo "matrix_json_for_unittest=${{ steps.generate.outputs.matrix_json_for_unittest }}" |
| 39 | + echo |
| 40 | + echo "matrix_json_for_smoketest=${{ steps.generate.outputs.matrix_json_for_smoketest }}" |
| 41 | + echo |
| 42 | + echo "matrix_json_for_performancetest=${{ steps.generate.outputs.matrix_json_for_performancetest }}" |
| 43 | +
|
| 44 | + run-child-unittest: |
| 45 | + name: Execute unittest child pipeline |
| 46 | + needs: prepare |
| 47 | + if: contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'unittest') |
| 48 | + uses: ./.github/workflows/ci_child_for_unittest.yml |
| 49 | + with: |
| 50 | + matrix_json: ${{ needs.prepare.outputs.matrix_json_for_unittest }} |
| 51 | + |
| 52 | + run-child-smoketest: |
| 53 | + name: Execute smoketest child pipeline |
| 54 | + needs: prepare |
| 55 | + if: contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'smoketest') |
| 56 | + uses: ./.github/workflows/ci_child_for_smoketest.yml |
| 57 | + with: |
| 58 | + matrix_json: ${{ needs.prepare.outputs.matrix_json_for_smoketest }} |
| 59 | + |
| 60 | + run-child-performancetest: |
| 61 | + name: Execute performancetest child pipeline |
| 62 | + needs: prepare |
| 63 | + if: contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'performancetest') |
| 64 | + uses: ./.github/workflows/ci_child_for_performancetest.yml |
| 65 | + with: |
| 66 | + matrix_json: ${{ needs.prepare.outputs.matrix_json_for_performancetest }} |
0 commit comments