Skip to content

Commit 40ba9dd

Browse files
committed
CI: enhance workflow_dispatch inputs for job selection
1 parent 252afba commit 40ba9dd

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/test_pyqt5.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@ on:
1111
pull_request:
1212
branches: [ "main", "develop", "release" ]
1313
workflow_dispatch:
14+
inputs:
15+
job_to_run:
16+
description: 'Which job to run'
17+
required: true
18+
type: choice
19+
options:
20+
- 'all'
21+
- 'build'
22+
- 'build_latest'
23+
default: 'all'
1424
schedule:
1525
- cron: "0 5 * * 1"
1626

1727
jobs:
1828
build:
29+
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.job_to_run == 'all' || github.event.inputs.job_to_run == 'build' }}
1930

2031
env:
2132
DISPLAY: ':99.0'
@@ -91,7 +102,7 @@ jobs:
91102
run: pytest -v --tb=long
92103

93104
build_latest:
94-
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
105+
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.job_to_run == 'all' || github.event.inputs.job_to_run == 'build_latest')) }}
95106
continue-on-error: true
96107
env:
97108
DISPLAY: ':99.0'

0 commit comments

Comments
 (0)