Skip to content

Commit

Permalink
HSC-260: Add GitHub Actions pipelines (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyachoke authored Jul 18, 2024
1 parent 9509125 commit d68c9ed
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check for dependency changes

on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'

jobs:
check-deps:
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-check-deps-build-publish.yml@main
with:
java-version: "8"
notify-ocd3: true
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
OCD3_USERNAME: ${{ secrets.OCD3_USERNAME }}
OCD3_PASSWORD: ${{ secrets.OCD3_PASSWORD }}
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

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

jobs:
validate:
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main
with:
java-version: "8"
use-secrets: true
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

release:
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }}
needs: validate
uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main
secrets:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

notify-ocd3:
needs: release
uses: mekomsolutions/shared-github-workflow/.github/workflows/ocd3-notify.yml@main
secrets:
OCD3_USERNAME: ${{ secrets.OCD3_USERNAME }}
OCD3_PASSWORD: ${{ secrets.OCD3_PASSWORD }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ buildNumber.properties
# JDT-specific (Eclipse Java Development Tools)
.classpath

effective-pom.xml

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
Expand Down
107 changes: 103 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<!-- Classifier for the dependency report artifact -->
<dependencyReportClassifier>dependencies</dependencyReportClassifier>
</properties>

<dependencies>
Expand All @@ -32,7 +34,7 @@
<type>zip</type>
<version>1.0.0-SNAPSHOT</version>
</dependency>

<!-- TODO: Add any implementation-specific dependencies -->
</dependencies>

Expand Down Expand Up @@ -75,19 +77,59 @@
<goals>
<goal>execute</goal>
</goals>
<!-- Disable this inherited execution -->
<!-- Disable this inherited execution -->
<phase>none</phase>
<configuration>
<scripts>
<script>file://${project.build.directory}/openmrs/frontend_assembly/build-openmrs-frontend.groovy</script>
<script>
file://${project.build.directory}/openmrs/frontend_assembly/build-openmrs-frontend.groovy</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<!-- Compile a dependency report -->
<plugin>
<groupId>net.mekomsolutions.maven.plugin</groupId>
<artifactId>dependency-tracker-maven-plugin</artifactId>
<executions>
<execution>
<id>Compile dependency report</id>
<phase>compile</phase>
<goals>
<goal>track</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Attach the dependency report to the build -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>Attach the dependency report</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>
${project.build.directory}/${project.artifactId}-${project.version}-dependencies.txt</file>
<type>txt</type>
<classifier>${dependencyReportClassifier}</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>validator</id>
Expand Down Expand Up @@ -123,4 +165,61 @@
</build>
</profile>
</profiles>

<repositories>
<repository>
<id>mks-nexus-public</id>
<url>https://nexus.mekomsolutions.net/repository/maven-public/</url>
</repository>
<repository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
</repository>
</repositories>

<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>
<pluginRepository>
<id>openmrs-snapshots</id>
<name>OpenMRS Public Repository</name>
<url>https://mavenrepo.openmrs.org/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>mks-nexus-public</id>
<url>https://nexus.mekomsolutions.net/repository/maven-public/</url>
</pluginRepository>
<pluginRepository>
<id>mks-nexus-snapshots</id>
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<name>Mekom Solutions Nexus repo for releases</name>
<id>mks-nexus-public-releases</id>
<url>https://nexus.mekomsolutions.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<name>Mekom Solutions Nexus repo for snapshots</name>
<id>mks-nexus-public-snapshots</id>
<url>https://nexus.mekomsolutions.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

0 comments on commit d68c9ed

Please sign in to comment.