2023-01-13 04:16:58 -05:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
2023-02-01 06:31:29 -05:00
|
|
|
# limitations under the License
|
2023-01-13 04:16:58 -05:00
|
|
|
|
2023-05-22 02:14:34 -04:00
|
|
|
name: "Unit tests workflow"
|
2023-01-13 04:16:58 -05:00
|
|
|
on:
|
2023-02-01 06:31:29 -05:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
jdk:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
description: 'JDK version used to test Druid'
|
|
|
|
sql_compatibility:
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: true
|
|
|
|
description: 'For SQL compatibility'
|
2023-05-22 02:14:34 -04:00
|
|
|
outputs:
|
|
|
|
continue_tests:
|
|
|
|
description: 'Flag to decide if next tests need to run incase coverage issue failures'
|
|
|
|
value: |
|
|
|
|
${{
|
2023-06-22 02:57:23 -04:00
|
|
|
(jobs.indexing_modules_test.result == 'success' || jobs.indexing_modules_test.result == 'skipped' ||
|
|
|
|
fromJson(jobs.indexing_modules_test.outputs.coverage_failure)) &&
|
|
|
|
(jobs.processing_modules_test.result == 'success' || jobs.processing_modules_test.result == 'skipped' ||
|
|
|
|
fromJson(jobs.processing_modules_test.outputs.coverage_failure)) &&
|
|
|
|
(jobs.server_modules_test.result == 'success' || jobs.server_modules_test.result == 'skipped' || fromJson
|
|
|
|
(jobs.server_modules_test.outputs.coverage_failure)) &&
|
|
|
|
(jobs.other_modules_test.result == 'success' || jobs.other_modules_test.result == 'skipped' || fromJson(jobs
|
|
|
|
.other_modules_test.outputs.coverage_failure))
|
2023-05-22 02:14:34 -04:00
|
|
|
}}
|
2023-01-13 04:16:58 -05:00
|
|
|
|
|
|
|
jobs:
|
2023-06-22 02:57:23 -04:00
|
|
|
changes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
# Required permissions
|
|
|
|
permissions:
|
|
|
|
pull-requests: read
|
|
|
|
# Set job outputs to values from filter step
|
|
|
|
outputs:
|
|
|
|
kafka: ${{ steps.filter.outputs.kafka }}
|
|
|
|
kinesis: ${{ steps.filter.outputs.kinesis }}
|
|
|
|
# run everything if not a PR
|
|
|
|
core: ${{ steps.filter.outputs.core || github.event_name != 'pull_request'}}
|
|
|
|
steps:
|
2024-03-08 03:05:26 -05:00
|
|
|
- uses: dorny/paths-filter@v3.0.0
|
2023-06-22 02:57:23 -04:00
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
core:
|
|
|
|
- '!extension*/**'
|
|
|
|
kafka:
|
|
|
|
- 'extensions-core/kafka-indexing-service/**'
|
|
|
|
kinesis:
|
|
|
|
- 'extensions-core/kinesis-indexing-service/**'
|
|
|
|
|
2023-02-01 06:31:29 -05:00
|
|
|
indexing_modules_test:
|
2023-06-22 02:57:23 -04:00
|
|
|
needs: changes
|
|
|
|
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.kafka == 'true' || needs.changes.outputs.kinesis == 'true'}}
|
2023-02-03 23:11:17 -05:00
|
|
|
uses: ./.github/workflows/reusable-unit-tests.yml
|
2023-02-01 06:31:29 -05:00
|
|
|
with:
|
|
|
|
jdk: ${{ inputs.jdk }}
|
|
|
|
sql_compatibility: ${{ inputs.sql_compatibility }}
|
|
|
|
module: indexing
|
|
|
|
maven_projects: 'indexing-hadoop,indexing-service,extensions-core/kafka-indexing-service,extensions-core/kinesis-indexing-service'
|
|
|
|
|
|
|
|
processing_modules_test:
|
2023-06-22 02:57:23 -04:00
|
|
|
needs: changes
|
|
|
|
if: ${{ needs.changes.outputs.core == 'true' }}
|
2023-02-03 23:11:17 -05:00
|
|
|
uses: ./.github/workflows/reusable-unit-tests.yml
|
2023-02-01 06:31:29 -05:00
|
|
|
with:
|
|
|
|
jdk: ${{ inputs.jdk }}
|
|
|
|
sql_compatibility: ${{ inputs.sql_compatibility }}
|
|
|
|
module: processing
|
|
|
|
maven_projects: 'processing'
|
|
|
|
|
|
|
|
server_modules_test:
|
2023-06-22 02:57:23 -04:00
|
|
|
needs: changes
|
|
|
|
if: ${{ needs.changes.outputs.core == 'true' }}
|
2023-02-03 23:11:17 -05:00
|
|
|
uses: ./.github/workflows/reusable-unit-tests.yml
|
2023-02-01 06:31:29 -05:00
|
|
|
with:
|
|
|
|
jdk: ${{ inputs.jdk }}
|
|
|
|
sql_compatibility: ${{ inputs.sql_compatibility }}
|
|
|
|
module: server
|
|
|
|
maven_projects: 'server'
|
|
|
|
|
|
|
|
other_modules_test:
|
2023-02-03 23:11:17 -05:00
|
|
|
uses: ./.github/workflows/reusable-unit-tests.yml
|
2023-02-01 06:31:29 -05:00
|
|
|
with:
|
|
|
|
jdk: ${{ inputs.jdk }}
|
|
|
|
sql_compatibility: ${{ inputs.sql_compatibility }}
|
|
|
|
module: other
|
|
|
|
maven_projects: '!processing,!indexing-hadoop,!indexing-service,!extensions-core/kafka-indexing-service,!extensions-core/kinesis-indexing-service,!server,!web-console,!integration-tests,!:druid-it-tools,!:druid-it-image,!:druid-it-cases'
|