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 5, 2024
1 parent efd966c commit 87821a7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 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
50 changes: 50 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,56 @@
</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" />
</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 87821a7

Please sign in to comment.