Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
description: "Java version to setup"
default: 17
cache:
description: "Cache Maven repo"
description: "Cache Maven repo (true/false/restore)"
default: true
download_dependencies:
description: "Download all Maven dependencies so Maven can work in offline mode"
Expand Down Expand Up @@ -38,7 +38,7 @@ runs:
with:
distribution: 'temurin' # use same JDK distro as in Trino docker images
java-version: ${{ inputs.java-version }}
- name: Cache local Maven repo
- name: Cache and Restore local Maven repo
id: cache
if: ${{ format('{0}', inputs.cache) == 'true' }}
uses: actions/cache@v3
Expand All @@ -47,6 +47,15 @@ runs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Restore local Maven repo
id: cache_restore
if: ${{ format('{0}', inputs.cache) == 'restore' }}
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Fetch any missing dependencies
shell: bash
if: ${{ format('{0}', inputs.download_dependencies) == 'true' }}
Expand Down
41 changes: 13 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- name: Maven Package
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand All @@ -198,10 +200,6 @@ jobs:
# The main Error Prone run
$MAVEN ${MAVEN_TEST} -T 1C clean verify -DskipTests -P gib,errorprone-compiler \
-pl '!:trino-docs,!:trino-server,!:trino-server-rpm'
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

web-ui-checks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -231,6 +229,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down Expand Up @@ -275,10 +275,6 @@ jobs:
path: |
**/*.hprof
retention-days: ${{ env.HEAP_DUMP_RETENTION_DAYS }}
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

hive-tests:
runs-on: ubuntu-latest
Expand All @@ -300,6 +296,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- name: Install Hive Module
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down Expand Up @@ -426,10 +424,6 @@ jobs:
check_name: ${{ github.job }} (${{ matrix.config }}) with secrets
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

test-other-modules:
runs-on: ubuntu-latest
Expand All @@ -445,6 +439,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
Expand Down Expand Up @@ -516,10 +512,6 @@ jobs:
path: |
**/*.hprof
retention-days: ${{ env.HEAP_DUMP_RETENTION_DAYS }}
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

build-test-matrix:
runs-on: ubuntu-latest
Expand All @@ -534,6 +526,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- name: Update PR check
uses: ./.github/actions/update-check
if: >-
Expand Down Expand Up @@ -603,10 +597,6 @@ jobs:
./.github/bin/build-matrix-from-impacted.py -v -i gib-impacted.log -m .github/test-matrix.yaml -o matrix.json
echo "Matrix: $(jq '.' matrix.json)"
echo "matrix=$(jq -c '.' matrix.json)" >> $GITHUB_OUTPUT
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

test:
runs-on: ubuntu-latest
Expand All @@ -628,6 +618,7 @@ jobs:
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
java-version: ${{ matrix.jdk != '' && matrix.jdk || '17' }}
- name: Cleanup node
# This is required as a virtual environment update 20210219.1 left too little space for MemSQL to work
Expand Down Expand Up @@ -816,10 +807,6 @@ jobs:
check_name: ${{ github.job }} with secrets
conclusion: ${{ job.status }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

build-pt:
runs-on: ubuntu-latest
Expand All @@ -835,6 +822,8 @@ jobs:
github.event.client_payload.pull_request.head.sha == github.event.client_payload.slash_command.args.named.sha &&
format('refs/pull/{0}/head', github.event.client_payload.pull_request.number) || '' }}
- uses: ./.github/actions/setup
with:
cache: restore
- uses: dorny/paths-filter@v2
id: filter
with:
Expand Down Expand Up @@ -1053,10 +1042,6 @@ jobs:
run: |
echo "Matrix: $(jq '.' matrix.json)"
echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT
- name: Clean local Maven repo
# Avoid creating a cache entry because this job doesn't download all dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository

pt:
runs-on: ubuntu-latest
Expand Down