Skip to content

Commit 1ccaee1

Browse files
authored
Run konflux builds and tests on all PRs (#1841)
1 parent c1ed9b3 commit 1ccaee1

File tree

3 files changed

+82
-100
lines changed

3 files changed

+82
-100
lines changed

.github/workflows/konflux-tests.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.github/workflows/konflux.yml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: Run konflux workflows
1+
name: Test Konflux builds
22

33
on:
4-
schedule:
5-
- cron: 0 6 * * *
64
push:
75
branches:
86
- master
@@ -20,10 +18,85 @@ concurrency:
2018
cancel-in-progress: true
2119

2220
jobs:
23-
run-tests:
24-
uses: ./.github/workflows/konflux-tests.yml
25-
if: github.event_name != 'pull_request' ||
26-
contains(github.head_ref, 'konflux') ||
27-
contains(github.head_ref, 'rhtap')
21+
init:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
collector-tag: ${{ steps.generate-tag.outputs.collector-tag }}
25+
collector-qa-tag: ${{ steps.generate-tag.outputs.collector-qa-tag }}
26+
rebuild-qa-containers: ${{ steps.filter.outputs.container }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.head_ref || github.ref_name }}
31+
submodules: true
32+
fetch-depth: 0
33+
34+
- uses: dorny/paths-filter@v3
35+
id: filter
36+
with:
37+
list-files: shell
38+
39+
# Only trigger a rebuild when the QA tag has changed
40+
filters: |
41+
container:
42+
- integration-tests/container/QA_TAG
43+
44+
- id: generate-tag
45+
run: |
46+
echo "collector-tag=$(make tag)-fast" >> "$GITHUB_OUTPUT"
47+
48+
COLLECTOR_QA_TAG="$(cat ${{ github.workspace }}/integration-tests/container/QA_TAG)"
49+
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${{ steps.filter.outputs.container }}" == "true" ]]; then
50+
COLLECTOR_QA_TAG="${COLLECTOR_QA_TAG}-${COLLECTOR_TAG}"
51+
fi
52+
53+
echo "collector-qa-tag=${COLLECTOR_QA_TAG}" >> "$GITHUB_OUTPUT"
54+
55+
wait-for-images:
56+
runs-on: ubuntu-latest
57+
needs:
58+
- init
59+
steps:
60+
- uses: stackrox/actions/release/wait-for-image@v1
61+
with:
62+
token: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
63+
image: rhacs-eng/collector:${{ needs.init.outputs.collector-tag }}
64+
limit: 9000 # 2h30m
65+
66+
integration-tests-containers:
67+
uses: ./.github/workflows/integration-test-containers.yml
68+
needs:
69+
- init
70+
with:
71+
collector-tag: ${{ needs.init.outputs.collector-tag }}
72+
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
73+
rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }}
2874
secrets: inherit
2975

76+
run-konflux-tests:
77+
uses: ./.github/workflows/integration-tests.yml
78+
needs:
79+
- init
80+
- wait-for-images
81+
- integration-tests-containers
82+
with:
83+
collector-tag: ${{ needs.init.outputs.collector-tag }}
84+
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
85+
collector-tests-tag: ${{ needs.integration-tests-containers.outputs.collector-tests-tag }}
86+
is-konflux: true
87+
job-tag: konf
88+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
89+
secrets: inherit
90+
91+
k8s-integration-tests:
92+
uses: ./.github/workflows/k8s-integration-tests.yml
93+
with:
94+
collector-tag: ${{ needs.init.outputs.collector-tag }}
95+
collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }}
96+
collector-tests-tag: ${{ needs.integration-tests-containers.outputs.collector-tests-tag }}
97+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
98+
needs:
99+
- init
100+
- wait-for-images
101+
- integration-tests-containers
102+
secrets: inherit

.tekton/collector-build.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ metadata:
88
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
99
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
1010
pipelinesascode.tekton.dev/max-keep-runs: "500"
11-
# TODO(ROX-21073): re-enable for all PR branches
1211
pipelinesascode.tekton.dev/on-cel-expression: |
13-
(event == "push" && target_branch.matches("^(master|release-.*)$")) ||
14-
(event == "pull_request" && (source_branch.matches("(konflux|appstudio|rhtap)") || body.pull_request.labels.exists(l, l.name == "konflux-build")))
12+
(event == "push" && target_branch.matches("^(master|release-.*)$")) || event == "pull_request"
1513
labels:
1614
appstudio.openshift.io/application: acs
1715
appstudio.openshift.io/component: collector

0 commit comments

Comments
 (0)