Skip to content

Commit

Permalink
Remove 1 by 1 validation with .NET validator and update Java validator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzautke authored Nov 4, 2022
1 parent 756b58e commit 06b3f99
Showing 1 changed file with 4 additions and 54 deletions.
58 changes: 4 additions & 54 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ inputs:
required: true
JAVA_VALIDATOR_VERSION:
description: 'Version of org.hl7.fhir.core library used for Java-based validation'
default: '5.6.65'
default: '5.6.75'
required: true
SUSHI_VERSION:
description: 'Version of SUSHI used for compiling the FSH files'
Expand Down Expand Up @@ -233,58 +233,8 @@ runs:
# --------------------------------------------------------------------------------------------------- #
# .NET VALIDATOR #
# --------------------------------------------------------------------------------------------------- #

# Add conformance resources for validation to the stack
- name: Add resources to the Firely Terminal stack
run: |
if $INPUT_DOTNET_VALIDATION_ENABLED; then
echo "Starting validation using .NET validator (Conformance resources) ..."
echo "Trying to validate conformance resources located at the following relative path(s): $INPUT_PATH_TO_CONFORMANCE_RESOURCES"
for p in $INPUT_PATH_TO_CONFORMANCE_RESOURCES;
do
echo Accessing "$p" and pushing resources to the stack...
if [ -d "$GITHUB_WORKSPACE/$p" ]; then
cd $GITHUB_WORKSPACE/$p
fhir push .
else
echo Cannot access "$p" as the path does not exist
fi
done
fi
shell: bash
env:
INPUT_PATH_TO_CONFORMANCE_RESOURCES: ${{ inputs.PATH_TO_CONFORMANCE_RESOURCES }}
INPUT_DOTNET_VALIDATION_ENABLED: ${{ inputs.DOTNET_VALIDATION_ENABLED }}

# Validate all conformance resources on the stack
- name: Validate all conformance resources in scope of the repository
run: |
if $INPUT_DOTNET_VALIDATION_ENABLED; then
count=0
while true; do
currentResource=$(fhir peek || true)
if [[ "$currentResource" == *"The stack is empty."* ]]; then
echo "Validation was executed for all conformance resources on the stack. Validated $count conformance resource(s)."
break
fi
((count=count+1))
echo "Validating $currentResource ..."
result=$(fhir validate)
echo $result
if echo $result | grep -Eq "*"INVALID"*" && echo $INPUT_EXPECTED_FAILS | grep -w -q -v VALIDATION_CONFORMANCE_DOTNET; then
exit 1
fi
fhir pop > /dev/null
done
fi
shell: bash
env:
INPUT_DOTNET_VALIDATION_ENABLED: ${{ inputs.DOTNET_VALIDATION_ENABLED }}
INPUT_EXPECTED_FAILS: ${{ inputs.EXPECTED_FAILS }}

# Run Quality Control checks

# Run Quality Control checks incl. validation
- name: Run Quality Control checks
run: |
if $INPUT_DOTNET_VALIDATION_ENABLED; then
Expand All @@ -304,7 +254,7 @@ runs:
env:
INPUT_DOTNET_VALIDATION_ENABLED: ${{ inputs.DOTNET_VALIDATION_ENABLED }}

#Examples are currently not used as Firely Terminal can't validate against profiles on the stack right now
#Examples are currently not used as Firely Terminal can't differentiate between these two in QC checks.

# --------------------------------------------------------------------------------------------------- #
# JAVA Validator #
Expand Down

0 comments on commit 06b3f99

Please sign in to comment.