Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 7f0b0fc

Browse files
authored
Run ITs on GitHub PR comment (#1331)
We could just comment with >/run-integration-tests and have the IT run
1 parent 3adfeac commit 7f0b0fc

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
<!-- A note on testing your PR -->
3+
<!-- Basic unit test run is executed against each commit in the PR.
4+
If you want to run a full integration test suite, you can trigger it by commenting
5+
with '/run-integration-tests' -->

.github/workflows/integration-tests.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,37 @@ on:
88
GIT_REF:
99
description: 'Commit hash to run the tests'
1010
required: true
11+
issue_comment:
12+
types: [created]
13+
1114
jobs:
15+
check-comment:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/run-integration-tests' }}
18+
outputs:
19+
ref: ${{ steps.get-pr-ref.outputs.ref }}
20+
steps:
21+
- name: Get PR ref
22+
id: get-pr-ref
23+
run: |
24+
PR_URL="${{ github.event.issue.pull_request.url }}"
25+
PR_INFO=$(curl -s -H "Authorization: token ${{ github.token }}" $PR_URL)
26+
echo "ref=$(echo $PR_INFO | jq -r .head.sha)" >> $GITHUB_OUTPUT
27+
1228
build-quesma-docker-image:
29+
needs: [check-comment]
30+
if: ${{ always() && (github.event_name != 'issue_comment' || needs.check-comment.result == 'success') }}
1331
uses: ./.github/workflows/build-quesma-docker-image.yml
1432
with:
15-
REF: ${{inputs.GIT_REF}}
33+
REF: ${{ github.event.inputs.GIT_REF || needs.check-comment.outputs.ref }}
1634

1735
integration-test-run:
1836
runs-on: ubuntu-latest
1937
needs: [build-quesma-docker-image]
2038
steps:
2139
- uses: actions/checkout@v4
22-
with: ## @TODO REMOVE
23-
ref: ${{ github.event.inputs.GIT_REF }}
40+
with:
41+
ref: ${{ github.event.inputs.GIT_REF || needs.check-comment.outputs.ref }}
2442

2543
- name: Set up Go
2644
uses: actions/setup-go@v5

0 commit comments

Comments
 (0)