Skip to content

STAND-128: Add GitHub Actions workflow to build and test in Standalone 2.x Reff App#86

Merged
dkayiwa merged 17 commits intoopenmrs:openmrs-emr2from
Muta-Jonathan:STAND-128
Aug 25, 2025
Merged

STAND-128: Add GitHub Actions workflow to build and test in Standalone 2.x Reff App#86
dkayiwa merged 17 commits intoopenmrs:openmrs-emr2from
Muta-Jonathan:STAND-128

Conversation

@Muta-Jonathan
Copy link
Member

Ticket - https://openmrs.atlassian.net/browse/STAND-128

This ticket adds Github actions to the standalone repo to run on push and pull requests on the openmrs-emr2 branch
cc @dkayiwa @wikumChamith

@Muta-Jonathan
Copy link
Member Author

@dkayiwa For the windows we havent supported it on 2.x but will be the next step thats why its failing

with:
repository: openmrs/openmrs-core
ref: 2.8.x
path: openmrs-core
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this since for 2.8.x+ Snapshot artifacts are not published and cannot be pulled and built on CI this is a twist which later

 - name: Build and install openmrs-core
        run: |
          cd openmrs-core
          mvn clean install -DskipTests    

builds the repo like locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It results into

Downloaded from openmrs-repo: https://mavenrepo.openmrs.org/public/org/liquibase/liquibase-commercial/4.23.2/liquibase-commercial-4.23.2.pom (1.5 kB at 14 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for referenceapplication-standalone 2.6.0-SNAPSHOT:
[INFO] 
[INFO] referenceapplication-standalone .................... SUCCESS [ 21.971 s]
[INFO] referenceapplication-standalone-01 ................. FAILURE [ 17.403 s]
[INFO] referenceapplication-standalone-02 ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  39.491 s
[INFO] Finished at: 2025-08-25T07:28:49Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.liquibase:liquibase-maven-plugin:4.23.2:update (empty-database-create-schema) on project referenceapplication-standalone-01: Execution empty-database-create-schema of goal org.liquibase:liquibase-maven-plugin:4.23.2:update failed: Plugin org.liquibase:liquibase-maven-plugin:4.23.2 or one of its dependencies could not be resolved:
Error:  	Failed to read artifact descriptor for org.openmrs.api:openmrs-api:jar:2.8.1-SNAPSHOT
Error:  
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Error:  
Error:  After correcting the problems, you can resume the build with the command
Error:    mvn <args> -rf :referenceapplication-standalone-01

But only on CI and passes locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen when we need to use the 3.0.x branch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically tried the master branch but as we talk now it points 3.0.0 version ... by using this am hoping for future develops this will require manual overide to point to the branch its building towards

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include that in the documentation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes let me add it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa Have updated it

application_data_directory=appdata
reset_connection_password=true
vm_arguments=-Xmx512m -Xms512m -XX:NewSize=128m --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED
vm_arguments=-Xmx512m -Xms512m -XX:NewSize=128m --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a part of github actions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really let me remove it and add it in another PR

<configuration>
<finalName>openmrs-standalone</finalName>
<appendAssemblyId>false</appendAssemblyId>
<attach>true</attach>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we attaching?

Copy link
Member Author

@Muta-Jonathan Muta-Jonathan Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously i was facing

Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar (default-jar) on project referenceapplication-standalone-02: 
You have to use a classifier to attach supplemental artifacts to the project instead of replacing them.

Without attaching, Maven treats the assembly as a temporary build output, not an artifact, which breaks the build since it does not include openmrs-standalone.jar but attaching helps to treat it as the main artifact

<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>prepare-package</phase>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the phase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps the attaching not to temporarily treat it as a temporary build output

@dkayiwa dkayiwa merged commit a9b8c2f into openmrs:openmrs-emr2 Aug 25, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants