diff --git a/.github/workflows/konflux.yml b/.github/workflows/konflux.yml new file mode 100644 index 00000000000..75973b4c573 --- /dev/null +++ b/.github/workflows/konflux.yml @@ -0,0 +1,79 @@ +name: Run konflux tests + +on: + push: + branches: + - master + - release-* + tags: + - 3.*.* + pull_request: + branches: + - '**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' }} + 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