diff --git a/.github/workflows/konflux-tests.yml b/.github/workflows/konflux-tests.yml new file mode 100644 index 0000000000..ee3539132f --- /dev/null +++ b/.github/workflows/konflux-tests.yml @@ -0,0 +1,66 @@ +name: Run konflux tests + +on: + workflow_call: + +jobs: + init: + runs-on: ubuntu-latest + outputs: + collector-tag: ${{ steps.generate-tag.outputs.collector-tag }} + collector-qa-tag: ${{ steps.generate-tag.outputs.collector-qa-tag }} + rebuild-qa-containers: ${{ steps.filter.outputs.container }} + steps: + - uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: filter + with: + list-files: shell + + # Only trigger a rebuild when the QA tag has changed + filters: | + container: + - integration-tests/container/QA_TAG + + - id: generate-tag + run: | + echo "collector-tag='$(make tag)'" >> "$GITHUB_OUTPUT" + + COLLECTOR_QA_TAG="$(cat ${{ github.workspace }}/integration-tests/container/QA_TAG)" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${{ steps.filter.outputs.container }}" == "true" ]]; then + COLLECTOR_QA_TAG="${COLLECTOR_QA_TAG}-${COLLECTOR_TAG}" + fi + + echo "collector-tag-qa=${COLLECTOR_QA_TAG}" >> "$GITHUB_OUTPUT" + + wait-for-images: + runs-on: ubuntu-latest + needs: + - init + steps: + - uses: stackrox/actions/release/wait-for-images@v1 + with: + token: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }} + image: quay.io/rhacs-eng/collector:${{ needs.init.outputs.collector-tag }}-fast + + build-test-containers: + uses: ./.github/workflows/integration-test-containers.yml + needs: + - init + with: + collector-tag: ${{ needs.init.outputs.collector-tag }} + collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }} + rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }} + secrets: inherit + + run-konflux-tests: + uses: ./.github/workflows/integration-tests.yml + needs: + - init + - wait-for-images + with: + collector-tag: ${{ needs.init.outputs.collector-tag }} + collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }} + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }} + secrets: inherit diff --git a/.github/workflows/konflux.yml b/.github/workflows/konflux.yml index 021113ed4e..7137b5c89b 100644 --- a/.github/workflows/konflux.yml +++ b/.github/workflows/konflux.yml @@ -1,4 +1,4 @@ -name: Run konflux tests +name: Run konflux workflows on: push: @@ -8,74 +8,14 @@ on: tags: - 3.*.* pull_request: - branches: - - '**/*konflux*' - - '**/*rhtap*' - - '*konflux*' - - '*rhtap*' concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: - init: - runs-on: ubuntu-latest - outputs: - collector-tag: ${{ steps.generate-tag.outputs.collector-tag }} - collector-qa-tag: ${{ steps.generate-tag.outputs.collector-qa-tag }} - rebuild-qa-containers: ${{ steps.filter.outputs.container }} - steps: - - uses: actions/checkout@v4 - - - uses: dorny/paths-filter@v3 - id: filter - with: - list-files: shell - - # Only trigger a rebuild when the QA tag has changed - filters: | - container: - - integration-tests/container/QA_TAG - - - id: generate-tag - run: | - echo "collector-tag='$(make tag)'" >> "$GITHUB_OUTPUT" - - COLLECTOR_QA_TAG="$(cat ${{ github.workspace }}/integration-tests/container/QA_TAG)" - if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${{ steps.filter.outputs.container }}" == "true" ]]; then - COLLECTOR_QA_TAG="${COLLECTOR_QA_TAG}-${COLLECTOR_TAG}" - fi - - echo "collector-tag-qa=${COLLECTOR_QA_TAG}" >> "$GITHUB_OUTPUT" - - wait-for-images: - runs-on: ubuntu-latest - needs: - - init - steps: - - uses: stackrox/actions/release/wait-for-images@v1 - with: - token: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }} - image: quay.io/rhacs-eng/collector:${{ needs.init.outputs.collector-tag }}-fast - - build-test-containers: - uses: ./.github/workflows/integration-test-containers.yml - needs: - - init - with: - collector-tag: ${{ needs.init.outputs.collector-tag }} - collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }} - rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }} + run-tests: + uses: ./.github/workflows/konflux-tests.yml + if: contains(fromJSON('["konflux", "rhtap"]'), github.head_ref) secrets: inherit - run-konflux-tests: - uses: ./.github/workflows/integration-tests.yml - needs: - - init - - wait-for-images - with: - collector-tag: ${{ needs.init.outputs.collector-tag }} - collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }} - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }} - secrets: inherit