From 22406ef3370e5328815b817f21c774032b5d8df7 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 16 Feb 2025 09:44:15 +0100 Subject: [PATCH 1/3] Add workflow_dispatch with Google Test filter Add the workflow_dispatch trigger to the test.yaml workflow. Includes an input for an optional Google Test filter pattern. --- .github/workflows/test.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5a4e180cfa..5a19fe2f47 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,15 @@ name: test -on: [push, pull_request] +on: + push: + pull_request: + workflow_dispatch: + inputs: + gtest_filter: + description: 'Google Test filter' + +env: + GTEST_FILTER: ${{ github.event.inputs.gtest_filter || '*' }} jobs: ubuntu: From 027388814baf23c47f2cc48beabe5b57b9b61607 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 16 Feb 2025 10:09:09 +0100 Subject: [PATCH 2/3] Add OS selection to workflow_dispatch --- .github/workflows/test.yaml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5a19fe2f47..295e20522e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,6 +7,18 @@ on: inputs: gtest_filter: description: 'Google Test filter' + test_linux: + description: 'Test Linux' + type: boolean + default: true + test_macos: + description: 'Test MacOS' + type: boolean + default: true + test_windows: + description: 'Test Windows' + type: boolean + default: true env: GTEST_FILTER: ${{ github.event.inputs.gtest_filter || '*' }} @@ -14,7 +26,11 @@ env: jobs: ubuntu: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + if: > + (github.event_name == 'push') || + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || + (github.event_name == 'workflow_dispatch' && github.event.inputs.test_linux == 'true') steps: - name: checkout uses: actions/checkout@v4 @@ -27,7 +43,11 @@ jobs: macos: runs-on: macos-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + if: > + (github.event_name == 'push') || + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || + (github.event_name == 'workflow_dispatch' && github.event.inputs.test_macos == 'true') steps: - name: checkout uses: actions/checkout@v4 @@ -38,7 +58,11 @@ jobs: windows: runs-on: windows-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + if: > + (github.event_name == 'push') || + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || + (github.event_name == 'workflow_dispatch' && github.event.inputs.test_windows == 'true') steps: - name: Prepare Git for Checkout on Windows run: | From e34e8d5b19563dc65627b5ddd3199c9f554728d3 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 16 Feb 2025 11:43:50 +0100 Subject: [PATCH 3/3] Fix wording --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 295e20522e..370ad16346 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,15 +8,15 @@ on: gtest_filter: description: 'Google Test filter' test_linux: - description: 'Test Linux' + description: 'Test on Linux' type: boolean default: true test_macos: - description: 'Test MacOS' + description: 'Test on MacOS' type: boolean default: true test_windows: - description: 'Test Windows' + description: 'Test on Windows' type: boolean default: true