Skip to content

Commit

Permalink
Update pull-request.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
markiantorno committed Sep 19, 2024
1 parent 9f953c2 commit d0aa84e
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Pull Request Pipeline

on:
Expand All @@ -10,8 +11,9 @@ jobs:
container:
image: maven:3.9-eclipse-temurin-21-jammy
timeout-minutes: 60
env:
MAVEN_CACHE_FOLDER: $HOME/.m2/repository

env: # Define environment variables at the job level
MAVEN_CACHE_FOLDER: $HOME/.m2/repository # Ensure the cache folder is defined here

steps:
- name: Checkout code
Expand Down Expand Up @@ -39,7 +41,16 @@ jobs:
with:
path: ${{ env.MAVEN_CACHE_FOLDER }}
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
enableCrossOsArchive: true
enableCrossOsArchive: true # Enable cross-runner cache

- name: Checkout repository
uses: actions/checkout@v4 # Ensure repository is checked out for local actions

# - name: Set up Java
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '11'

- name: Install Docker
shell: bash
Expand All @@ -55,14 +66,16 @@ jobs:
pwd
ls -al $HOME/.m2/repository
env:
MAVEN_CACHE_FOLDER: $HOME/.m2/repository
MAVEN_CACHE_FOLDER: $HOME/.m2/repository # Ensure MAVEN_CACHE_FOLDER is available in this step

- name: Restore Maven Cache
uses: actions/cache@v4
with:
path: ${{ env.MAVEN_CACHE_FOLDER }}
path: $HOME/.m2/repository # Update path to use $HOME
enableCrossOsArchive: true # Enable cross-runner cache
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
enableCrossOsArchive: true
restore-keys: |
maven-${{ runner.os }}-
- name: Verify cache was restored
shell: bash
Expand All @@ -77,16 +90,15 @@ jobs:
- name: Build Maven Module
shell: bash
env:
MAVEN_CACHE_FOLDER: $HOME/.m2/repository
MAVEN_CACHE_FOLDER: $HOME/.m2/repository # Update to use $HOME
MAVEN_OPTS: '-Xmx1024m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
run: |
mvn clean verify jacoco:report -pl hapi-fhir-converter \
-P JACOCO,CI -e -B \
-Dmaven.repo.local=$MAVEN_CACHE_FOLDER \
-Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false \
-Dstyle.color=always -Djansi.force=true


# name: Pull Request Pipeline
Expand Down

0 comments on commit d0aa84e

Please sign in to comment.