Skip to content

Commit

Permalink
Update Maven dependency cache in maven-checks job
Browse files Browse the repository at this point in the history
When uploading a new cache entry it's important that the entry
be complete, to avoid the need of downloading more dependencies
during build.

This change explicitly downloads all dependencies in `maven-checks` job
which already builds all modules, to minimize additional work.
  • Loading branch information
MiguelWeezardo committed Oct 28, 2022
1 parent 2887668 commit 54b8b8b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,25 @@ jobs:
cache: 'maven'
- name: Configure Problem Matchers
run: echo "::add-matcher::.github/problem-matcher.json"
- name: Download all Trino dependencies to make sure cache is complete
run: |
$RETRY $MAVEN dependency:go-offline
- name: Maven Checks
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY $MAVEN clean install -B --strict-checksums -V -T C1 -DskipTests -P ci -pl '!:trino-server-rpm'
$MAVEN clean install -B --strict-checksums -V -T C1 -DskipTests -P ci -pl '!:trino-server-rpm'
- name: Test Server RPM
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
$RETRY $MAVEN verify -B --strict-checksums -P ci -pl :trino-server-rpm
$MAVEN verify -B --strict-checksums -P ci -pl :trino-server-rpm
- name: Clean Maven Output
run: $MAVEN clean -pl '!:trino-server,!:trino-cli'
- uses: docker/setup-qemu-action@v2
with:
platforms: arm64,ppc64le
- name: Test Docker Image
run: core/docker/build.sh
- name: Clean local Maven repo
- name: Remove Trino from local Maven repo to avoid caching it
# Avoid caching artifacts built in this job, cache should only include dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf ~/.m2/repository/io/trino/trino-*
Expand Down Expand Up @@ -116,6 +119,8 @@ jobs:
git rebase --verbose --exec "$MAVEN package ${MAVEN_COMPILE_COMMITS} ${MAVEN_GIB} || (git status && false)" $( git merge-base HEAD refs/remotes/origin/${{ github.event.pull_request.base.ref }} )
# The local repo is broken at this point, and should be abandoned
- 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

error-prone-checks:
Expand Down Expand Up @@ -146,6 +151,10 @@ jobs:
# The main Error Prone run
$MAVEN ${MAVEN_TEST} -T C1 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

0 comments on commit 54b8b8b

Please sign in to comment.