Skip to content

Commit 0273888

Browse files
Add OS selection to workflow_dispatch
1 parent 22406ef commit 0273888

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/test.yaml

+27-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,30 @@ on:
77
inputs:
88
gtest_filter:
99
description: 'Google Test filter'
10+
test_linux:
11+
description: 'Test Linux'
12+
type: boolean
13+
default: true
14+
test_macos:
15+
description: 'Test MacOS'
16+
type: boolean
17+
default: true
18+
test_windows:
19+
description: 'Test Windows'
20+
type: boolean
21+
default: true
1022

1123
env:
1224
GTEST_FILTER: ${{ github.event.inputs.gtest_filter || '*' }}
1325

1426
jobs:
1527
ubuntu:
1628
runs-on: ubuntu-latest
17-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
29+
if: >
30+
(github.event_name == 'push') ||
31+
(github.event_name == 'pull_request' &&
32+
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) ||
33+
(github.event_name == 'workflow_dispatch' && github.event.inputs.test_linux == 'true')
1834
steps:
1935
- name: checkout
2036
uses: actions/checkout@v4
@@ -27,7 +43,11 @@ jobs:
2743

2844
macos:
2945
runs-on: macos-latest
30-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
46+
if: >
47+
(github.event_name == 'push') ||
48+
(github.event_name == 'pull_request' &&
49+
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) ||
50+
(github.event_name == 'workflow_dispatch' && github.event.inputs.test_macos == 'true')
3151
steps:
3252
- name: checkout
3353
uses: actions/checkout@v4
@@ -38,7 +58,11 @@ jobs:
3858

3959
windows:
4060
runs-on: windows-latest
41-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
61+
if: >
62+
(github.event_name == 'push') ||
63+
(github.event_name == 'pull_request' &&
64+
github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) ||
65+
(github.event_name == 'workflow_dispatch' && github.event.inputs.test_windows == 'true')
4266
steps:
4367
- name: Prepare Git for Checkout on Windows
4468
run: |

0 commit comments

Comments
 (0)