diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index 2a0ac5a2a..140762ea9 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: 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: