|
1 | 1 | name: test |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + gtest_filter: |
| 9 | + description: 'Google Test filter' |
| 10 | + test_linux: |
| 11 | + description: 'Test on Linux' |
| 12 | + type: boolean |
| 13 | + default: true |
| 14 | + test_macos: |
| 15 | + description: 'Test on MacOS' |
| 16 | + type: boolean |
| 17 | + default: true |
| 18 | + test_windows: |
| 19 | + description: 'Test on Windows' |
| 20 | + type: boolean |
| 21 | + default: true |
| 22 | + |
| 23 | +env: |
| 24 | + GTEST_FILTER: ${{ github.event.inputs.gtest_filter || '*' }} |
4 | 25 |
|
5 | 26 | jobs: |
6 | 27 | ubuntu: |
7 | 28 | runs-on: ubuntu-latest |
8 | | - 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') |
9 | 34 | steps: |
10 | 35 | - name: checkout |
11 | 36 | uses: actions/checkout@v4 |
|
18 | 43 |
|
19 | 44 | macos: |
20 | 45 | runs-on: macos-latest |
21 | | - 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') |
22 | 51 | steps: |
23 | 52 | - name: checkout |
24 | 53 | uses: actions/checkout@v4 |
|
29 | 58 |
|
30 | 59 | windows: |
31 | 60 | runs-on: windows-latest |
32 | | - 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') |
33 | 66 | steps: |
34 | 67 | - name: Prepare Git for Checkout on Windows |
35 | 68 | run: | |
|
0 commit comments