Skip to content

Commit b99de9f

Browse files
authored
Add PR trigger to verify changes in sts workflow for every change (#11833)
Signed-off-by: Jakub Stejskal <[email protected]>
1 parent c5dc0d6 commit b99de9f

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

.github/actions/systemtests/parse-comment/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
profile:
1414
description: "Comma-separated or single profile name(s)"
1515
required: false
16-
default: ""
16+
default: "smoke"
1717

1818
outputs:
1919
pipelineList:
@@ -73,6 +73,9 @@ runs:
7373
7474
if (ev === 'workflow_dispatch') {
7575
shouldRun = true;
76+
} else if (ev === 'pull_request') {
77+
// Auto-run smoke tests on PR workflow changes
78+
shouldRun = true;
7679
} else if (ev === 'issue_comment' && context.payload?.issue?.pull_request) {
7780
shouldRun = /^\s*\/gha\s+run\b/i.test(body || '');
7881
}
@@ -89,7 +92,8 @@ runs:
8992
with:
9093
script: |
9194
const body = context.payload?.comment?.body ?? '';
92-
const fallback = `/gha run profile=${process.env.INPUT_PROFILE} kafkaVersion=${process.env.INPUT_KAFKA_VERSION}`;
95+
const profile = process.env.INPUT_PROFILE || 'smoke';
96+
const fallback = `/gha run profile=${profile} kafkaVersion=${process.env.INPUT_KAFKA_VERSION}`;
9397
const builtComment = (body && body.trim().length) ? body : fallback;
9498
9599
core.setOutput('builtComment', builtComment);

.github/actions/utils/set-defaults/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ runs:
1717
echo "TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
1818
1919
# Check if we're in a pull request context
20-
if [[ "${{ github.event.issue.pull_request }}" != "" && "${{ github.event.issue.pull_request }}" != "null" ]]; then
20+
if [[ "${{ github.event.issue.pull_request }}" != "" && "${{ github.event.issue.pull_request }}" != "null" ]] || [[ "${{ github.event_name }}" == "pull_request" ]]; then
2121
echo "Detected: Pull Request"
2222
2323
echo "PULL_REQUEST=true" >> $GITHUB_ENV
2424
echo "DOCKER_ORG=strimzi" >> $GITHUB_ENV
2525
echo "TAG=pr" >> $GITHUB_ENV
26+
# For PR events, preserve the DOCKER_REGISTRY set by setup-kind (Kind registry)
2627
else
2728
# Not a PR - use standard Strimzi settings
2829
echo "PULL_REQUEST=false" >> $GITHUB_ENV

.github/tests/scenarios/parse-comment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ scenarios:
207207
fixture: .github/tests/events/parse-comment/dispatch_empty.json
208208
expectations:
209209
pipelines: ""
210-
profiles: "operators,operands,brokers-and-security,azp_kraft_upgrade,azp_kafka_upgrade"
210+
profiles: "smoke"
211211
strimzi_feature_gates: ""
212212
strimzi_rbac_scope: ""
213213
cluster_operator_install_type: "yaml"

.github/workflows/system-tests.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ on:
2020
# Automated trigger for issue comment
2121
issue_comment:
2222
types: [created]
23+
# Testing trigger for PRs - tests workflow changes
24+
pull_request:
25+
types: [opened, synchronize]
26+
paths:
27+
- '.github/workflows/run-system-tests.yml'
28+
- '.github/workflows/system-tests.yml'
2329

2430
permissions:
2531
contents: read
@@ -69,7 +75,7 @@ jobs:
6975
check-rights:
7076
needs:
7177
- parse-params
72-
if: ${{ needs.parse-params.outputs.shouldRun == 'true' }}
78+
if: ${{ needs.parse-params.outputs.shouldRun == 'true' && github.event_name != 'pull_request' }}
7379
runs-on: ubuntu-latest
7480
permissions:
7581
contents: read
@@ -99,7 +105,7 @@ jobs:
99105
- parse-params
100106
- check-rights
101107
# Run only if properly triggered, permissions check passed, and the run is not for release (already built images)
102-
if: ${{ needs.parse-params.outputs.shouldRun == 'true' && needs.check-rights.result == 'success' && needs.parse-params.outputs.releaseVersion == 'latest' }}
108+
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && (needs.check-rights.result == 'success' || github.event_name == 'pull_request') && needs.parse-params.outputs.releaseVersion == 'latest' }}
103109
runs-on: oracle-2cpu-8gb-arm64
104110
steps:
105111
- uses: actions/checkout@v5
@@ -117,7 +123,7 @@ jobs:
117123
- check-rights
118124
- build-artifacts
119125
# Run only if properly triggered, permissions check passed, and the run is not for release (already built images)
120-
if: ${{ needs.parse-params.outputs.shouldRun == 'true' && needs.check-rights.result == 'success' && needs.parse-params.outputs.releaseVersion == 'latest' && needs.build-artifacts.result != 'failure'}}
126+
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && (needs.check-rights.result == 'success' || github.event_name == 'pull_request') && needs.parse-params.outputs.releaseVersion == 'latest' && needs.build-artifacts.result != 'failure'}}
121127
strategy:
122128
matrix:
123129
architecture: [amd64, arm64]
@@ -139,7 +145,7 @@ jobs:
139145
- build-artifacts
140146
- build-images
141147
# Run if properly triggered, permissions check passed, and build jobs succeeded or were skipped
142-
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && needs.check-rights.result == 'success' && needs.build-images.result != 'failure' && needs.build-artifacts.result != 'failure' }}
148+
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && (needs.check-rights.result == 'success' || github.event_name == 'pull_request') && needs.build-images.result != 'failure' && needs.build-artifacts.result != 'failure' }}
143149
# Job needs write rights for setting statuses on pull-requests
144150
permissions:
145151
contents: read
@@ -166,7 +172,7 @@ jobs:
166172
- parse-params
167173
- check-rights
168174
- run-tests
169-
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && needs.check-rights.result == 'success' }}
175+
if: ${{ always() && needs.parse-params.outputs.shouldRun == 'true' && needs.check-rights.result == 'success' && github.event_name != 'pull_request' }}
170176
runs-on: ubuntu-latest
171177
permissions:
172178
contents: read

0 commit comments

Comments
 (0)