1- name : CI
1+ name : Continuous Integration
22
33on :
44 pull_request :
88jobs :
99 build-tools :
1010 runs-on : ubuntu-latest
11+ strategy :
12+ matrix :
13+ java : [ 'openjdk8', 'openjdk11' ]
14+ fail-fast : false
1115 steps :
1216 - uses : actions/checkout@v1
13- - name : Set up JDK 1.8
14- uses : actions /setup-java @v1
17+ - name : Set up OpenJDK
18+ uses : joschi /setup-jdk @v1
1519 with :
16- java-version : 1.8
20+ java-version : ${{ matrix.java }}
1721 - name : Build tools
1822 run : mvn -B install --file fhir-tools/pom.xml
1923 - name : Build samples
@@ -26,33 +30,80 @@ jobs:
2630 run : mvn -B package --file fhir-benchmark/pom.xml
2731 build :
2832 runs-on : ubuntu-latest
33+ strategy :
34+ matrix :
35+ java : [ 'openjdk8', 'openjdk11' ]
36+ fail-fast : false
2937 steps :
3038 - uses : actions/checkout@v1
31- - name : Set up JDK 1.8
32- uses : actions /setup-java @v1
39+ - name : Set up OpenJDK
40+ uses : joschi /setup-jdk @v1
3341 with :
34- java-version : 1.8
42+ java-version : ${{ matrix.java }}
3543 - name : Build samples
36- run : mvn -B install --file fhir-examples/pom.xml
44+ run : mvn -B install --file fhir-examples/pom.xml --no-transfer-progress
3745 - name : Build parent with tests
38- run : mvn -B -T2C package --file fhir-parent/pom.xml
46+ env :
47+ BASE : origin/${{ github['base_ref'] }}
48+ run : |
49+ jdbc_paths=(
50+ fhir-search/src/main
51+ fhir-persistence/src/main
52+ fhir-persistence-schema/src/main
53+ fhir-persistence-jdbc
54+ )
55+ model_paths=(
56+ fhir-model
57+ )
58+ declare -a PROFILES_ARR
59+
60+ if [ -n "$(git --no-pager diff --name-only ${BASE} ${GITHUB_SHA} -- ${jdbc_paths[@]})" ]; then
61+ echo "Changes affect fhir-persistence-jdbc, running ALL"
62+ PROFILES_ARR+=(jdbc-all-tests)
63+ else
64+ echo "No changes affect fhir-persistence-jdbc, running MINIMAL"
65+ fi
66+
67+ if [ -n "$(git --no-pager diff --name-only ${BASE} ${GITHUB_SHA} -- ${model_paths[@]})" ]; then
68+ echo "Changes affect fhir-model, running ALL"
69+ PROFILES_ARR+=(model-all-tests)
70+ else
71+ echo "No changes affect fhir-model, running MINIMAL"
72+ fi
73+
74+ if [ ${#PROFILES[@]} -eq 0 ]; then
75+ # Convert the PROFILES_ARR array to a comma-delimited string
76+ PROFILES=$(IFS=, ; echo "${PROFILES_ARR[*]}")
77+ echo "Using profiles ${PROFILES}"
78+ mvn -B -T2C package --file fhir-parent/pom.xml -P "${PROFILES}" --no-transfer-progress
79+ else
80+ mvn -B -T2C package --file fhir-parent/pom.xml --no-transfer-progress
81+ fi
3982 e2e-tests :
4083 runs-on : ubuntu-latest
84+ strategy :
85+ matrix :
86+ java : [ 'openjdk8', 'openjdk11' ]
87+ fail-fast : false
4188 steps :
4289 - uses : actions/checkout@v1
43- - name : Set up JDK 1.8
44- uses : actions /setup-java @v1
90+ - name : Set up OpenJDK
91+ uses : joschi /setup-jdk @v1
4592 with :
46- java-version : 1.8
93+ java-version : ${{ matrix.java }}
4794 - name : Build samples
48- run : mvn -B install --file fhir-examples/pom.xml
95+ run : mvn -B install --file fhir-examples/pom.xml --no-transfer-progress
4996 - name : Build parent without tests
50- run : mvn -B install --file fhir-parent/pom.xml -DskipTests
97+ run : mvn -B install --file fhir-parent/pom.xml -DskipTests --no-transfer-progress
5198 - name : Server Integration Tests
99+ env :
100+ # debian-based linux uses C.UTF-8 by default and Derby doesn't like that
101+ LC_ALL : en_US.UTF-8
52102 run : |
53103 export WORKSPACE=${GITHUB_WORKSPACE}
54104 build/pre-integration-test.sh
55- mvn test -DskipTests=false -f fhir-server-test/pom.xml -DskipWebSocketTest=true
105+ env
106+ mvn -B test -DskipTests=false -f fhir-server-test/pom.xml -DskipWebSocketTest=true --no-transfer-progress
56107 build/post-integration-test.sh
57108 - name : Gather error logs
58109 if : failure()
69120 if : always()
70121 uses : actions/upload-artifact@master
71122 with :
72- name : integration-test-results
123+ name : integration-test-results-${{ matrix.java }}
73124 path : SIT/integration-test-results
0 commit comments