Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
findingrish committed Jul 16, 2024
1 parent a8d2c68 commit 7575570
Showing 1 changed file with 75 additions and 28 deletions.
103 changes: 75 additions & 28 deletions .github/workflows/file3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,48 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Xyz"
name: "Unit & Integration tests CI Old"
on:
push:
paths-ignore:
- '**/*.md'
- 'dev/**'
- 'docs/**'
- 'examples/**/jupyter-notebooks/**'
- 'web-console/**'
- 'website/**'
branches:
- master
- '[0-9]+.[0-9]+.[0-9]+' # release branches
- '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches
pull_request:
paths-ignore:
- '**/*.md'
- 'dev/**'
- 'docs/**'
- 'examples/**/jupyter-notebooks/**'
- 'web-console/**'
- 'website/**'
branches:
- master
- '[0-9]+.[0-9]+.[0-9]+' # release branches
- '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' # release branches

concurrency:
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
cancel-in-progress: true

env:
MYSQL_DRIVER_CLASSNAME: com.mysql.jdbc.Driver # Used to set druid config in docker image for revised ITs
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
BACKWARD_COMPATIBILITY_IT_ENABLED: false
DRUID_PREVIOUS_VERSION: 30.0.0
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: https://dlcdn.apache.org/druid/30.0.0/apache-druid-30.0.0-bin.tar.gz
DRUID_PREVIOUS_IT_IMAGE_NAME: org.apache.druid.integration-tests/test:30.0.0

jobs:
test-build:
name: "build"
build:
name: "build (jdk${{ matrix.jdk }})"
strategy:
fail-fast: false
matrix:
jdk: [ '8', '11', '17', '21' ]
runs-on: ubuntu-latest
steps:
- name: Checkout branch
Expand All @@ -36,7 +65,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 8
java-version: ${{ matrix.jdk }}

# 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
Expand All @@ -45,7 +74,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-8-${{ github.sha }}
key: maven-${{ runner.os }}-${{ matrix.jdk }}-${{ github.sha }}
restore-keys: setup-java-Linux-maven-${{ hashFiles('**/pom.xml') }}

- name: Cache targets
Expand All @@ -54,15 +83,15 @@ jobs:
with:
path: |
./**/target
key: maven-${{ runner.os }}-8-targets-${{ github.sha }}
key: maven-${{ runner.os }}-${{ matrix.jdk }}-targets-${{ github.sha }}

- name: Cache image
id: docker_container
uses: actions/cache@v4
with:
key: druid-container-jdk8.tar.gz-${{ github.sha }}
key: druid-container-jdk${{ matrix.jdk }}.tar.gz-${{ github.sha }}
path: |
./druid-container-jdk8.tar.gz
./druid-container-jdk${{ matrix.jdk }}.tar.gz
./integration-tests-ex/image/target/env.sh
- name: Maven build
Expand All @@ -74,27 +103,45 @@ jobs:
run: |
./it.sh image
source ./integration-tests-ex/image/target/env.sh
docker tag $DRUID_IT_IMAGE_NAME $DRUID_IT_IMAGE_NAME-jdk8
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-jdk8.tar.gz
docker save "$DRUID_IT_IMAGE_NAME" | gzip > druid-container-jdk${{ matrix.jdk }}.tar.gz
- name: Save old version docker image
if: (${{ env.BACKWARD_COMPATIBILITY_IT_ENABLED == 'true' }}
run: |
docker tag $DRUID_PREVIOUS_IT_IMAGE_NAME $DRUID_PREVIOUS_IT_IMAGE_NAME-jdk8-version${{ inputs.DRUID_PREVIOUS_VERSION }}
echo $DRUID_PREVIOUS_IT_IMAGE_NAME
docker save "$DRUID_PREVIOUS_IT_IMAGE_NAME" | gzip > druid-container-jdk8-version${{ inputs.DRUID_PREVIOUS_VERSION }}.tar.gz
unit-tests-phase2:
strategy:
fail-fast: false
matrix:
jdk: [ 11, 17, 21 ]
name: "unit tests (jdk${{ matrix.jdk }}, sql-compat=true)"
uses: ./.github/workflows/unit-tests.yml
needs: unit-tests
if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
with:
jdk: ${{ matrix.jdk }}
sql_compatibility: true

test-revised-its:
needs: test-build
if: ${{ always() }}
uses: ./.github/workflows/revised-its.yml
unit-tests:
strategy:
fail-fast: false
matrix:
sql_compatibility: [ false, true ]
name: "unit tests (jdk8, sql-compat=${{ matrix.sql_compatibility }})"
uses: ./.github/workflows/unit-tests.yml
needs: build
with:
BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ env.BACKWARD_COMPATIBILITY_IT_ENABLED }}
DRUID_PREVIOUS_VERSION: ${{ env.DRUID_PREVIOUS_VERSION }}
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ env.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ env.DRUID_PREVIOUS_IT_IMAGE_NAME }}
jdk: 8
sql_compatibility: ${{ matrix.sql_compatibility }}

standard-its:
needs: unit-tests
if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
uses: ./.github/workflows/standard-its.yml

revised-its:
needs: unit-tests
if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }}
uses: ./.github/workflows/revised-its.yml

0 comments on commit 7575570

Please sign in to comment.