Skip to content

Commit

Permalink
KH-376: OpenMRS config to be CI validated
Browse files Browse the repository at this point in the history
  • Loading branch information
chinzou committed Oct 10, 2023
1 parent a5ddcb3 commit 63106d4
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/validate-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Publish

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'

- name: Set settings.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "mks-nexus-private",
"username": "${{ secrets.MEKOM_NEXUS_USERNAME }}",
"password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}"
},
{
"id": "mks-nexus-private-snapshots",
"username": "${{ secrets.MEKOM_NEXUS_USERNAME }}",
"password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}"
}]
- name: Build and validate distro
run: mvn --batch-mode clean install -P validator
60 changes: 59 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,55 @@
<module>prod</module>
</modules>
</profile>
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>copy-config</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy
todir="${project.build.directory}/configuration">
<fileset dir="${project.basedir}/configs/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-configurations</id>
<phase>integration-test</phase>
<goals>
<goal>validate-configurations</goal>
</goals>
<configuration>
<sourceDir>
${project.build.directory}/configuration</sourceDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>com.ozonehis</groupId>
Expand Down Expand Up @@ -66,4 +113,15 @@
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>

<pluginRepositories>
<pluginRepository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

0 comments on commit 63106d4

Please sign in to comment.