Skip to content

Pull Request Pipeline #79

Pull Request Pipeline

Pull Request Pipeline #79

Workflow file for this run

name: Pull Request Pipeline
on:
workflow_dispatch:
jobs:
# generate-module-list:
# name: Generate List of Modules to Build
# runs-on: ubuntu-latest
# outputs:
# modules_list: ${{ steps.format_modules.outputs.modules_list }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Generate Modules List
# id: generate_list
# uses: ./.github/actions/generate-module-list
# with:
# ignored_modules: 'hapi-fhir-bom,hapi-deployable-pom,...'
# - name: Print generated modules
# run: |
# echo "Modules list generated:"
# echo "${{ steps.generate_list.outputs.modules_list }}" | tr ',' '\n'
# - name: Format Modules List as JSON Array
# id: format_modules
# run: |
# echo "modules_list=$(echo '${{ steps.generate_list.outputs.modules_list }}' | jq -R -s -c 'split(",")')" >> $GITHUB_OUTPUT
build-cache:
name: Setup Cache
runs-on: ubuntu-latest
container:
image: maven:3.9-eclipse-temurin-21-jammy
timeout-minutes: 60
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
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
# - name: Create Maven cache folder
# run: |
# export MAVEN_CACHE_FOLDER="$HOME/.m2/repository"
# mkdir -p $MAVEN_CACHE_FOLDER && pwd && ls -al $MAVEN_CACHE_FOLDER
# - name: Check Permissions
# run: |
# ls -ld $HOME/.m2
# ls -ld $HOME/.m2/repository
- name: Build with Maven
env:
# JAVA_HOME_11_X64: /opt/java/openjdk
# MAVEN_CACHE_FOLDER: /root/.m2/repository
MAVEN_OPTS: '-Xmx1024m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto'
run: |
mvn install -P CI,CHECKSTYLE -Dmaven.test.skip=true -e -B \
-Dmaven.repo.local=$MAVEN_CACHE_FOLDER \
-Dmaven.javadoc.skip=true \
-Dmaven.wagon.http.pool=false \
-Dhttp.keepAlive=false \
-Dstyle.color=always -Djansi.force=true
- name: Cache Maven repository
uses: actions/cache@v4
with:
path: ${{ env.MAVEN_CACHE_FOLDER }}
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# - name: Save Maven dependencies
# uses: actions/cache@v3
# with:
# path: ~/.m2/repository
# key: maven-${{ runner.os }}-${{ hashFiles('pom.xml') }}
build-modules:
name: Build Modules
runs-on: ubuntu-latest
needs:
# - generate-module-list
- build-cache
strategy:
matrix:
# module: ${{ fromJSON(needs.generate-module-list.outputs.modules_list) }}
module: [ "hapi-fhir-converter","hapi-fhir-validation","hapi-fhir-structures-dstu2" ]
max-parallel: 256
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensure repository is checked out for local actions
- name: Build Modules
uses: ./.github/actions/build-module
with:
name: ${{ github.event.pull_request.head.ref }} # refers to the branch from which the pull request was created
module: ${{ matrix.module }}