Skip to content

Commit

Permalink
OpenMRS config to be CI validated
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Dec 29, 2024
1 parent fe24ad4 commit 94dae00
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types: [published]

jobs:
build:
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 }}
53 changes: 53 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,59 @@
</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"/>
</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 94dae00

Please sign in to comment.