Skip to content

Commit

Permalink
Use setup-java@v4 parameter for CI dep caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacBlanco committed Feb 7, 2025
1 parent 4930bf5 commit baafb3e
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 133 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/arrow-flight-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,14 @@ jobs:
with:
show-progress: false

# Set up Java for the build environment
# Set up Java and dependencies for the build environment
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: 'temurin'
java-version: 8

# Cache Maven dependencies to speed up the build
- name: Cache local Maven repository
if: needs.changes.outputs.codechange == 'true'
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
# Resolve Maven dependencies (if cache is not found)
- name: Populate Maven cache
if: steps.cache-maven.outputs.cache-hit != 'true' && needs.changes.outputs.codechange == 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs

# Install dependencies for the target module
- name: Maven Install
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,15 @@ jobs:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: Install LaTeX dependencies
run: |
sudo apt-get update
sudo apt-get install -y texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra latexmk tex-gyre texlive-xetex fonts-freefont-otf xindy
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
- uses: actions/setup-java@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress
distribution: 'temurin'
java-version: 8
cache: 'maven'
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/hive-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Install Hive Module
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/kudu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/maven-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress -P ci && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/product-tests-basic-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/product-tests-specific-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/singlestore-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Install SingleStore Module
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/spark-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,9 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/test-other-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,12 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
# Workaround for Ubuntu 24 and mysql to find the dependent library (https://github.com/prestodb/presto/issues/24327)
- name: Create symlink for libaio.so.1
run: sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,12 @@ jobs:
with:
show-progress: false
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: 'temurin'
java-version: 8
- name: Cache local Maven repository
if: needs.changes.outputs.codechange == 'true'
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-2-
- name: Populate maven cache
if: steps.cache-maven.outputs.cache-hit != 'true' && needs.changes.outputs.codechange == 'true'
run: ./mvnw de.qaware.maven:go-offline-maven-plugin:resolve-dependencies --no-transfer-progress && .github/bin/download_nodejs
cache: 'maven'
- name: Download nodejs to maven cache
run: .github/bin/download_nodejs
- name: Maven Install
if: needs.changes.outputs.codechange == 'true'
run: |
Expand Down

0 comments on commit baafb3e

Please sign in to comment.