From 32777ade3a3810b5fa2249609c4903485669d740 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Thu, 11 Dec 2025 11:58:54 +0900 Subject: [PATCH 1/3] ci: only trigger e2e test on pr comment --- .github/workflows/e2e_test.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index 2a0ac5a2a..477c4c46b 100644 --- a/.github/workflows/e2e_test.yaml +++ b/.github/workflows/e2e_test.yaml @@ -1,17 +1,32 @@ name: End-to-End tests on: - pull_request: + issue_comment: + types: [created] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: + check_comment: + name: Check comment trigger + runs-on: ubuntu-latest + if: github.event.issue.pull_request && contains(github.event.comment.body, 'ci: run e2e') + outputs: + triggered: ${{ steps.check.outputs.triggered }} + steps: + - name: Check comment + id: check + run: | + echo "triggered=true" >> $GITHUB_OUTPUT + # test option values defined at test/conftest.py are passed on via repository secret # INTEGRATION_TEST_ARGS to operator-workflows automatically. openstack-integration-end-to-end-test: name: end-to-end test using private-endpoint + needs: check_comment + if: needs.check_comment.outputs.triggered == 'true' uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main secrets: inherit with: From d07d384991a8f24b6412b58a66f116f29b6063c9 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Thu, 11 Dec 2025 13:20:49 +0900 Subject: [PATCH 2/3] ci: fix syntax (double quote to allow colon) --- .github/workflows/e2e_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index 477c4c46b..140762ea9 100644 --- a/.github/workflows/e2e_test.yaml +++ b/.github/workflows/e2e_test.yaml @@ -12,7 +12,7 @@ jobs: check_comment: name: Check comment trigger runs-on: ubuntu-latest - if: github.event.issue.pull_request && contains(github.event.comment.body, 'ci: run e2e') + if: "${{ github.event.issue.pull_request && contains(github.event.comment.body, 'ci: run e2e') }}" outputs: triggered: ${{ steps.check.outputs.triggered }} steps: From 110c6958b1b0e5379addfc14bbca5bed4a110958 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Thu, 11 Dec 2025 13:23:22 +0900 Subject: [PATCH 3/3] docs: contributing guide to trigger ci --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eef030a23..e3cab86f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,6 +55,8 @@ environment variable settings under [repository](https://github.com/canonical/gi > settings > variables > actions. This is to prevent GitHub from leaking secrets when passing them over the CLI calls (unresolved). +To trigger E2E tests (required status check), you can comment "ci: run e2e" on the Pull Request itself. This is to prevent resource intensive CI runs on every PR. + ### Building the charm Build the charm in this git repository using: