Skip to content

Commit

Permalink
[KYUUBI #4747] [INFRA] Install and cache build/mvn in CI builds
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

- introduce a custom action for installing and caching Maven, to prevent repeatedly downloading Maven binary from remote.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4747 from bowenliang123/cache-maven.

Closes #4747

bbd9e1f [liangbowen] fix cache path
dc34218 [liangbowen] add action for caching maven in ci builds

Authored-by: liangbowen <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
bowenliang123 authored and pan3793 committed Apr 23, 2023
1 parent 2c55a1f commit 83c4bed
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/setup-maven/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.
#

name: setup-maven
description: 'Install and cache maven'
runs:
using: composite
steps:
- name: Restore cached Maven
uses: actions/cache@v3
with:
path: build/apache-maven-*
key: setup-maven-${{ hashFiles('pom.xml') }}
- name: Install Maven
shell: bash
run: build/mvn -v
2 changes: 2 additions & 0 deletions .github/workflows/dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
java-version: 8
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Check kyuubi modules available
id: modules-check
run: >-
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
check-latest: false
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -131,6 +133,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Kyuubi AuthZ with supported Spark versions
Expand Down Expand Up @@ -177,6 +181,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build Flink with maven w/o linters
Expand Down Expand Up @@ -223,6 +229,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Hive with maven w/o linters
Expand Down Expand Up @@ -260,6 +268,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test JDBC with maven w/o linters
Expand Down Expand Up @@ -297,6 +307,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Build and test Trino with maven w/o linters
Expand Down Expand Up @@ -329,6 +341,8 @@ jobs:
java-version: 8
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: Run TPC-DS Tests
Expand Down Expand Up @@ -466,6 +480,8 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Cache Engine Archives
uses: ./.github/actions/cache-engine-archives
- name: zookeeper integration tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
java-version: 8
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Build with Maven
run: ./build/mvn clean install ${{ matrix.profiles }} -Dmaven.javadoc.skip=true -V
- name: Upload test logs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
java-version: 8
cache: 'maven'
check-latest: false
- name: Setup Maven
uses: ./.github/actions/setup-maven
- name: Setup Python 3
uses: actions/setup-python@v4
with:
Expand Down

0 comments on commit 83c4bed

Please sign in to comment.