Pull Request Pipeline #235
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request Pipeline | |
on: | |
workflow_dispatch: | |
jobs: | |
build_cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build the Maven cache | |
id: cache-maven | |
uses: ./.github/actions/cache-maven | |
with: | |
java-version: '17' | |
cache-path: $HOME/.m2/repository | |
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-validation,hapi-fhir-structures-r4,hapi-fhir-storage-cr,hapi-fhir-jpaserver-test-utilities,hapi-fhir-jpaserver-test-r4,hapi-fhir-jpaserver-test-r4,hapi-fhir-jpaserver-mdm,hapi-fhir-jpaserver-base,hapi-fhir-jpaserver-elastic-test-utilities,hapi-fhir-cli/hapi-fhir-cli-api,hapi-fhir-bom,hapi-deployable-pom,hapi-fhir-spring-boot-sample-client-apache,hapi-fhir-spring-boot-sample-client-okhttp,hapi-fhir-spring-boot-starter,hapi-fhir-spring-boot-samples,hapi-fhir-validation-resources-dstu2.1,hapi-fhir-structures-r4b,hapi-fhir-validation-resources-r4b,hapi-fhir-jpa,hapi-fhir-serviceloaders,hapi-fhir-storage-batch2-test-utilities,hapi-fhir-cli,hapi-fhir-dist,hapi-fhir-jacoco,hapi-fhir-server-cds-hooks,hapi-fhir-caching-testing,hapi-fhir-cli-app,hapi-fhir-karaf-features,hapi-fhir-karaf-integration-tests,osgi' | |
# ignored_modules: 'hapi-fhir-bom,hapi-deployable-pom,hapi-fhir-spring-boot-sample-client-apache,hapi-fhir-spring-boot-sample-client-okhttp,hapi-fhir-spring-boot-starter,hapi-fhir-spring-boot-samples,hapi-fhir-validation-resources-dstu2.1,hapi-fhir-structures-r4b,hapi-fhir-validation-resources-r4b,hapi-fhir-jpa,hapi-fhir-serviceloaders,hapi-fhir-storage-batch2-test-utilities,hapi-fhir-cli,hapi-fhir-dist,hapi-fhir-jacoco,hapi-fhir-server-cds-hooks,hapi-fhir-caching-testing,hapi-fhir-cli-app,hapi-fhir-karaf-features,hapi-fhir-karaf-integration-tests,osgi' | |
- name: Format Modules List as JSON Array | |
id: format_modules | |
run: | | |
# Use jq to format the modules list as a JSON array | |
echo "modules_list=$(jq -R -s -c 'split(",") | map(gsub("[\\n]"; ""))' <<< '${{ steps.generate_list.outputs.modules_list }}')" >> $GITHUB_OUTPUT | |
- name: Print formatted modules as JSON | |
run: | | |
echo "Formatted JSON Array:" | |
echo "${{ steps.format_modules.outputs.modules_list }}" | |
test-module: | |
runs-on: ubuntu-latest | |
needs: | |
- build_cache | |
- generate_module_list | |
strategy: | |
matrix: | |
# module: ["hapi-fhir-jpaserver-test-r4"] | |
module: ${{ fromJSON(needs.generate_module_list.outputs.modules_list) }} | |
max-parallel: 256 | |
fail-fast: false | |
steps: | |
# Step to check out the repository, which includes local actions | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run Tests and Archive Results | |
uses: ./.github/actions/run-tests-and-archive-results | |
with: | |
java-version: '17' | |
maven-cache-folder: $HOME/.m2/repository | |
module-name: ${{ matrix.module }} | |
assemble-test-reports: | |
runs-on: ubuntu-latest | |
needs: | |
- generate_module_list | |
- test-module | |
steps: | |
# Step to check out the repository, which includes local actions | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/assemble-test-reports | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
modules: ${{ needs.generate_module_list.outputs.modules_list }} | |