Skip to content

Commit 5ca8d8b

Browse files
committed
Update global-ci workflows to also be able to test UI run-ui-tests
Since the global-ci will run for any PR that changes the run-ui-tests action in the tackle2-ui repository, we want to be able to use the those changes in the global-ci run. This is done by checking out the tackle2-ui repository at a specific ref and running the run-ui-tests action "locally". See CI fails in konveyor/tackle2-ui#2787 for the motivation for this change. Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
1 parent 7a31e9b commit 5ca8d8b

2 files changed

Lines changed: 33 additions & 13 deletions

File tree

.github/workflows/global-ci-bundle.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,21 +465,23 @@ jobs:
465465
bundle_image: ${{ inputs.operator_bundle == '' && env.operator_bundle || inputs.operator_bundle }}
466466
namespace: ${{ inputs.namespace }}
467467
tackle_cr: ${{ inputs.tackle_cr }}
468+
# end DRY
468469

469470
- name: Wait for Ingress and expose UI service
471+
id: ui-url
470472
run: |
471-
kubectl wait \
473+
kubectl wait
472474
-n konveyor-tackle \
473475
ingress/tackle \
474476
--timeout=600s \
475477
--for=jsonpath='{.status.loadBalancer.ingress[0].ip}'
476478
477479
ingress_ip=$(kubectl get ingress/tackle -n konveyor-tackle -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
478480
echo "ingress is ready at: ${ingress_ip}"
479-
echo "UI_URL=https://${ingress_ip}" >>$GITHUB_ENV
480-
# end DRY
481+
echo "ui_url=https://${ingress_ip}" >>"$GITHUB_OUTPUT"
481482
482483
- name: Extract pull request number from inputs or PR description
484+
id: ui-tests-ref
483485
shell: bash
484486
env:
485487
body: ${{ github.event.pull_request.body }}
@@ -489,12 +491,20 @@ jobs:
489491
&& UI_TESTS_REF=${{ inputs.ui_tests_ref }} \
490492
|| UI_TESTS_REF=refs/pull/$PULL_REQUEST_NUMBER/merge
491493
492-
echo "UI_TESTS_REF=${UI_TESTS_REF}" >>"$GITHUB_ENV"
494+
echo "ref=${UI_TESTS_REF}" >>"$GITHUB_OUTPUT"
493495
echo "Using UI_TESTS_REF \`${UI_TESTS_REF}\`" >>"$GITHUB_STEP_SUMMARY"
494496
497+
- name: "Checkout run-ui-tests action (ref: ${{ inputs.ui_tests_ref }})"
498+
uses: actions/checkout@v4
499+
with:
500+
repository: konveyor/tackle2-ui
501+
path: tackle2-ui
502+
ref: ${{ inputs.ui_tests_ref }}
503+
sparse-checkout: .github/actions/run-ui-tests
504+
495505
- name: Run UI tests
496-
uses: konveyor/tackle2-ui/.github/actions/run-ui-tests@main
506+
uses: ./tackle2-ui/.github/actions/run-ui-tests
497507
with:
498508
test_tags: ${{ inputs.ui_test_tags }}
499-
tests_ref: ${{ env.UI_TESTS_REF }}
500-
base_url: ${{ env.UI_URL }}
509+
tests_ref: ${{ steps.ui-tests-ref.outputs.ref }}
510+
base_url: ${{ steps.ui-url.outputs.ui_url }}

.github/workflows/global-ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,10 @@ jobs:
401401
image-pull-policy: IfNotPresent
402402
analyzer-container-memory: 0
403403
analyzer-container-cpu: 0
404+
# end DRY
404405

405406
- name: Wait for Ingress and expose UI service
407+
id: ui-url
406408
run: |
407409
kubectl wait \
408410
-n konveyor-tackle \
@@ -412,10 +414,10 @@ jobs:
412414
413415
ingress_ip=$(kubectl get ingress/tackle -n konveyor-tackle -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
414416
echo "ingress is ready at: ${ingress_ip}"
415-
echo "UI_URL=https://${ingress_ip}" >>$GITHUB_ENV
416-
# end DRY
417+
echo "ui_url=https://${ingress_ip}" >>"$GITHUB_OUTPUT"
417418
418419
- name: Extract pull request number from inputs or PR description
420+
id: ui-tests-ref
419421
shell: bash
420422
env:
421423
body: ${{ github.event.pull_request.body }}
@@ -425,12 +427,20 @@ jobs:
425427
&& UI_TESTS_REF=${{ inputs.ui_tests_ref }} \
426428
|| UI_TESTS_REF=refs/pull/$PULL_REQUEST_NUMBER/merge
427429
428-
echo "UI_TESTS_REF=${UI_TESTS_REF}" >>"$GITHUB_ENV"
430+
echo "ref=${UI_TESTS_REF}" >>"$GITHUB_OUTPUT"
429431
echo "Using UI_TESTS_REF \`${UI_TESTS_REF}\`" >>"$GITHUB_STEP_SUMMARY"
430432
433+
- name: "Checkout run-ui-tests action (ref: ${{ inputs.ui_tests_ref }})"
434+
uses: actions/checkout@v4
435+
with:
436+
repository: konveyor/tackle2-ui
437+
path: tackle2-ui
438+
ref: ${{ inputs.ui_tests_ref }}
439+
sparse-checkout: .github/actions/run-ui-tests
440+
431441
- name: Run UI tests
432-
uses: konveyor/tackle2-ui/.github/actions/run-ui-tests@main
442+
uses: ./tackle2-ui/.github/actions/run-ui-tests
433443
with:
434444
test_tags: ${{ inputs.ui_test_tags }}
435-
tests_ref: ${{ env.UI_TESTS_REF }}
436-
base_url: ${{ env.UI_URL }}
445+
tests_ref: ${{ steps.ui-tests-ref.outputs.ref }}
446+
base_url: ${{ steps.ui-url.outputs.ui_url }}

0 commit comments

Comments
 (0)