2023-02-01 17:01:29 +05:30
# 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
# limitations under the License.
2023-05-22 11:44:34 +05:30
name : "Unit & Integration tests CI"
2023-02-01 17:01:29 +05:30
on :
push :
2023-02-17 09:56:17 +05:30
paths-ignore :
2023-05-17 17:46:25 -07:00
- '**/*.md'
2023-02-17 09:56:17 +05:30
- 'dev/**'
2023-05-17 17:46:25 -07:00
- 'docs/**'
2023-05-29 23:31:45 -07:00
- 'examples/**/jupyter-notebooks/**'
2023-02-17 09:56:17 +05:30
- 'web-console/**'
2023-05-17 17:46:25 -07:00
- 'website/**'
2023-02-01 17:01:29 +05:30
branches :
- master
2023-04-12 09:13:40 +05:30
- '[0-9]+.[0-9]+.[0-9]+' # release branches
- '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches
2023-02-01 17:01:29 +05:30
pull_request :
2023-02-17 09:56:17 +05:30
paths-ignore :
2023-05-17 17:46:25 -07:00
- '**/*.md'
2023-02-17 09:56:17 +05:30
- 'dev/**'
2023-05-17 17:46:25 -07:00
- 'docs/**'
2023-05-29 23:31:45 -07:00
- 'examples/**/jupyter-notebooks/**'
2023-02-17 09:56:17 +05:30
- 'web-console/**'
2023-05-17 17:46:25 -07:00
- 'website/**'
2023-02-01 17:01:29 +05:30
branches :
- master
2023-04-12 09:13:40 +05:30
- '[0-9]+.[0-9]+.[0-9]+' # release branches
- '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches
2023-02-01 17:01:29 +05:30
concurrency :
2023-05-16 12:13:08 +05:30
group : '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' # group workflows only on pull_requests and not on branch commits
2023-02-01 17:01:29 +05:30
cancel-in-progress : true
env :
2023-02-15 11:03:25 +05:30
MYSQL_DRIVER_CLASSNAME : com.mysql.jdbc.Driver # Used to set druid config in docker image for revised ITs
2023-02-01 17:01:29 +05:30
SEGMENT_DOWNLOAD_TIMEOUT_MINS : 5
jobs :
build :
2023-05-22 11:44:34 +05:30
name : "build (jdk${{ matrix.jdk }})"
2023-02-01 17:01:29 +05:30
strategy :
fail-fast : false
matrix :
2023-10-06 12:45:07 -07:00
jdk : [ '8' , '11' , '17' , '21' ]
2023-02-01 17:01:29 +05:30
runs-on : ubuntu-latest
steps :
- name : Checkout branch
uses : actions/checkout@v3
2023-10-06 12:45:07 -07:00
# skip the "cache: maven" step from setup-java. We explicitly use a
# different cache key since we cannot reuse it across commits.
- uses : actions/setup-java@v3
with :
distribution : 'zulu'
java-version : ${{ matrix.jdk }}
2023-02-01 17:01:29 +05:30
2023-10-06 12:45:07 -07:00
# the build step produces SNAPSHOT artifacts into the local maven repository,
# we include github.sha in the cache key to make it specific to that build/jdk
2023-02-02 21:39:56 +05:30
- name : Cache Maven m2 repository
id : maven
uses : actions/cache@v3
with :
path : ~/.m2/repository
2023-02-03 15:49:17 -08:00
key : maven-${{ runner.os }}-${{ matrix.jdk }}-${{ github.sha }}
2023-09-28 21:27:52 +02:00
restore-keys : setup-java-Linux-maven-${{ hashFiles('**/pom.xml') }}
2023-02-02 21:39:56 +05:30
2023-02-01 17:01:29 +05:30
- name : Cache targets
id : target
uses : actions/cache@v3
with :
path : |
./**/target
2023-02-03 15:49:17 -08:00
key : maven-${{ runner.os }}-${{ matrix.jdk }}-targets-${{ github.sha }}
2023-02-01 17:01:29 +05:30
2023-02-03 15:49:17 -08:00
- name : Cache image
id : docker_container
uses : actions/cache@v3
with :
key : druid-container-jdk${{ matrix.jdk }}.tar.gz-${{ github.sha }}
path : |
./druid-container-jdk${{ matrix.jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh
- name : Maven build
id : maven_build
run : |
./it.sh ci
2023-02-01 17:01:29 +05:30
- name : Container build
run : |
./it.sh image
source ./integration-tests-ex/image/target/env.sh
docker tag $DRUID_IT_IMAGE_NAME $DRUID_IT_IMAGE_NAME-jdk${{ matrix.jdk }}
- name : Save docker container to archive
run : |
source ./integration-tests-ex/image/target/env.sh
echo $DRUID_IT_IMAGE_NAME
docker save "$DRUID_IT_IMAGE_NAME" | gzip > druid-container-jdk${{ matrix.jdk }}.tar.gz
2023-03-16 15:30:07 +05:30
unit-tests-phase2 :
2023-02-01 17:01:29 +05:30
strategy :
fail-fast : false
matrix :
2023-10-06 12:45:07 -07:00
jdk : [ 11 , 17 , 21 ]
2023-05-22 11:44:34 +05:30
name : "unit tests (jdk${{ matrix.jdk }}, sql-compat=true)"
2023-02-03 20:11:17 -08:00
uses : ./.github/workflows/unit-tests.yml
2023-03-16 15:30:07 +05:30
needs : unit-tests
2023-10-12 21:25:57 +05:30
if : ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
2023-02-01 17:01:29 +05:30
with :
2023-03-16 15:30:07 +05:30
jdk : ${{ matrix.jdk }}
sql_compatibility : true
2023-02-01 17:01:29 +05:30
2023-03-16 15:30:07 +05:30
unit-tests :
2023-02-01 17:01:29 +05:30
strategy :
fail-fast : false
matrix :
2023-03-16 15:30:07 +05:30
sql_compatibility : [ false , true ]
2023-05-22 11:44:34 +05:30
name : "unit tests (jdk8, sql-compat=${{ matrix.sql_compatibility }})"
2023-02-03 20:11:17 -08:00
uses : ./.github/workflows/unit-tests.yml
2023-03-16 15:30:07 +05:30
needs : build
2023-02-01 17:01:29 +05:30
with :
2023-03-16 15:30:07 +05:30
jdk : 8
sql_compatibility : ${{ matrix.sql_compatibility }}
2023-02-01 17:01:29 +05:30
standard-its :
needs : unit-tests
2023-05-22 11:44:34 +05:30
if : ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
2023-02-03 20:11:17 -08:00
uses : ./.github/workflows/standard-its.yml
2023-02-01 17:01:29 +05:30
revised-its :
needs : unit-tests
2023-05-22 11:44:34 +05:30
if : ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
2023-02-03 20:11:17 -08:00
uses : ./.github/workflows/revised-its.yml