diff --git a/.github/workflows/run-system-tests.yaml b/.github/workflows/run-system-tests.yaml index a6df5845964..e521a6fef36 100644 --- a/.github/workflows/run-system-tests.yaml +++ b/.github/workflows/run-system-tests.yaml @@ -38,6 +38,11 @@ on: default: 'false' required: false type: string + skipSystemTestRun: + description: "Skip system tests run" + required: false + default: 'false' + type: string workflow_call: inputs: *workflow-inputs secrets: @@ -48,6 +53,7 @@ on: jobs: discover_system_test_chunks: + if: ${{ inputs.skipSystemTestRun == 'false'}} runs-on: ubuntu-latest outputs: test_chunks: ${{ steps.discover.outputs.test_chunks }} @@ -69,6 +75,7 @@ jobs: run_system_tests: needs: [discover_system_test_chunks] + if: ${{ inputs.skipSystemTestRun == 'false'}} runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/system-tests-pr.yaml b/.github/workflows/system-tests-pr.yaml index 562e55f4ce8..41b6e9118a2 100644 --- a/.github/workflows/system-tests-pr.yaml +++ b/.github/workflows/system-tests-pr.yaml @@ -19,17 +19,17 @@ name: System Tests for Pull-Requests on: pull_request: types: [ opened, synchronize, reopened, labeled ] - paths-ignore: - - '**/**.md' - - '**/**.txt' - - '.github/**' - - '!.github/workflows/system-tests-pr.yaml' - - '!.github/workflows/run-system-tests.yaml' - - '!.github/workflows/build-kroxylicious-container-images.yaml' - - '!.github/actions/**' - - 'kroxylicious-docs**/**' - - 'kroxylicious-integration-test**/**' - - 'kroxylicious-*benchmarks/**' +# paths-ignore: +# - '**/**.md' +# - '**/**.txt' +# - '.github/**' +# - '!.github/workflows/system-tests-pr.yaml' +# - '!.github/workflows/run-system-tests.yaml' +# - '!.github/workflows/build-kroxylicious-container-images.yaml' +# - '!.github/actions/**' +# - 'kroxylicious-docs**/**' +# - 'kroxylicious-integration-test**/**' +# - 'kroxylicious-*benchmarks/**' branches: - "main" - 'release/**' @@ -40,10 +40,40 @@ concurrency: cancel-in-progress: true jobs: + # JOB to run change detection + changes: + runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + systemtest: ${{ steps.filter.outputs.systemtest }} + steps: + # For pull requests it's not necessary to check out the code + - uses: dorny/paths-filter@v4 + id: filter + with: + predicate-quantifier: 'some' + filters: | + systemtest: + - 'kroxylicious-**/**' + - '!kroxylicious-annotations/**' + - '!kroxylicious-docs**/**' + - '!kroxylicious-integration-test**/**' + - '!kroxylicious-*benchmarks/**' + - '!kroxylicious-test-images/**' + - '!kroxylicious-wire-fidelity-tests/**' + - '.github/workflows/system-tests-pr.yaml' + - '.github/workflows/run-system-tests.yaml' + - '.github/workflows/build-kroxylicious-container-images.yaml' + build_artifacts: + needs: changes uses: $/.github/workflows/build-kroxylicious-artifacts.yaml set_variables: + needs: changes runs-on: ubuntu-latest outputs: kafka_client: ${{ steps.kafkaClient.outputs.kafka_client }} @@ -80,7 +110,7 @@ jobs: echo "$KAFKA_CLIENT" run_system_tests: - needs: [build_artifacts,set_variables] + needs: [changes,build_artifacts,set_variables] uses: $/.github/workflows/run-system-tests.yaml secrets: KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY }} @@ -88,3 +118,4 @@ jobs: with: kafkaClient: ${{ needs.set_variables.outputs.kafka_client }} testFortanixKMS: ${{ contains(github.event.pull_request.labels.*.name, 'kms/fortanix') }} + skipSystemTestRun: ${{ needs.changes.outputs.systemtest == 'false' }}