Skip to content

Commit

Permalink
C2C-269: Add step to validate C2C OpenMRS config on PRs and pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Dec 12, 2024
1 parent efd966c commit ad191dd
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main
with:
java-version: "8"
maven-args: "-P validator" # OMRS config validation
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Uuid,Void/Retire,Name,Description,_version:1
e4f9bb8e-8ac5-405f-9baf-21dc8de28a73,,N/A,"Visit type used to be assigned to legacy visits, imported from the historical database",
e4f9bb8e-8ac5-405f-9baf-21dc8de28a73,True,,,
e4f9bb8e-8ac5-405f-9baf-21dc8de28a73,,N/A,"Visit type used to be assigned to legacy visits, imported from the historical database",
56 changes: 56 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,62 @@
</plugins>
</build>

<profiles>
<profile>
<id>validator</id>
<build>
<plugins>
<!-- copy over merged/packaged OpenMRS config for validation at the integration-test phase -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>Copy OpenMRS Initializer configs for validation</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/validator/configuration">
<fileset
dir="${project.build.directory}/${project.artifactId}-${project.version}/openmrs_config">
<!-- Exclude RelationshipTypes-1.zip -->
<exclude name="**/metadatasharing/RelationshipTypes-1.zip"/>
<exclude name="**/patientidentifiertypes/voids.csv"/>
<exclude name="**/roles/roles.csv"/>
<exclude name="**/bahmniforms/"/>
</fileset>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- hooking the OpenMRS config validation to the integration-test phase -->
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>Validate OpenMRS Initializer configs</id>
<phase>integration-test</phase>
<goals>
<goal>validate-configurations</goal>
</goals>
<configuration>
<sourceDir>
${project.build.directory}/validator/configuration</sourceDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<repositories>
<repository>
<id>mks-nexus-public</id>
Expand Down

0 comments on commit ad191dd

Please sign in to comment.