|
1 | 1 | name: CI |
| 2 | +run-name: "CI ${{ inputs.target }}${{ inputs.pr && format(' #{0}', inputs.pr) || '' }}" |
| 3 | + |
| 4 | +# On a pull request, a label starts its own run through Labels.yml |
| 5 | +# (CTActions docs/workflows/label-dispatch.md). |
2 | 6 |
|
3 | 7 | on: |
4 | 8 | push: |
5 | 9 | branches: |
6 | 10 | - main |
7 | 11 | tags: '*' |
8 | | - pull_request: |
9 | | - types: [labeled, synchronize, reopened] |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + pr: |
| 15 | + description: 'Pull request number, set by label-dispatch.yml' |
| 16 | + required: false |
| 17 | + default: '' |
| 18 | + target: |
| 19 | + description: 'github, occidata or kkt' |
| 20 | + required: false |
| 21 | + default: '' |
10 | 22 |
|
11 | 23 | jobs: |
12 | 24 | # Job for GitHub-hosted runners (ubuntu, macos, windows) |
13 | 25 | test-cpu-github: |
14 | | - # A 'labeled' event fires once per label added, and re-evaluates against the PR's |
15 | | - # *current* full label set — so adding several labels in a row would otherwise |
16 | | - # re-run this job on every subsequent label add. Only react to 'labeled' when it's |
17 | | - # this specific label; for other trigger types (synchronize/reopened), fall back to |
18 | | - # checking the current label set as before. |
19 | | - if: > |
20 | | - github.event_name != 'pull_request' || |
21 | | - (github.event.action == 'labeled' && github.event.label.name == 'run ci github-runner') || |
22 | | - (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'run ci github-runner')) |
| 26 | + if: github.event_name == 'push' || inputs.target == 'github' |
23 | 27 | uses: control-toolbox/CTActions/.github/workflows/ci.yml@main |
24 | 28 | with: |
25 | 29 | runs_on: '["ubuntu-latest", "macos-latest", "windows-latest"]' |
|
33 | 37 | # the plain suite: replaces the former dedicated GPU.yml workflow. Replaces the retired |
34 | 38 | # kkt runner (cf. CTParser.jl, CTFlows.jl). |
35 | 39 | test-gpu-occidata: |
36 | | - # See the comment on test-cpu-github above. |
37 | | - if: > |
38 | | - github.event_name == 'pull_request' && |
39 | | - ((github.event.action == 'labeled' && github.event.label.name == 'run ci occidata-runner') || |
40 | | - (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'run ci occidata-runner'))) |
| 40 | + if: inputs.target == 'occidata' |
41 | 41 | uses: control-toolbox/CTActions/.github/workflows/ci.yml@main |
42 | 42 | with: |
43 | 43 | versions: '["1"]' |
|
51 | 51 | # Job for the self-hosted kkt runner (GPU/CUDA), on its label only (a pull request can |
52 | 52 | # always ask for either GPU runner; a push picks one, see test-gpu-main). |
53 | 53 | test-gpu-kkt: |
54 | | - # See the comment on test-cpu-github above. |
55 | | - if: > |
56 | | - github.event_name == 'pull_request' && |
57 | | - ((github.event.action == 'labeled' && github.event.label.name == 'run ci kkt-runner') || |
58 | | - (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'run ci kkt-runner'))) |
| 54 | + if: inputs.target == 'kkt' |
59 | 55 | uses: control-toolbox/CTActions/.github/workflows/ci.yml@main |
60 | 56 | with: |
61 | 57 | runs_on: '[["kkt"]]' |
|
68 | 64 | # On a push (main, tags): a single GPU run, on kkt unless it is offline, else occidata |
69 | 65 | # (CTActions ci-gpu.yml). A busy kkt is waited for. |
70 | 66 | test-gpu-main: |
71 | | - if: github.event_name != 'pull_request' |
| 67 | + if: github.event_name == 'push' |
72 | 68 | uses: control-toolbox/CTActions/.github/workflows/ci-gpu.yml@main |
73 | 69 | with: |
74 | 70 | use_ct_registry: true |
|
0 commit comments