Skip to content

Commit ca11f41

Browse files
Add documentation and patch file for java-common-libs migration
Co-authored-by: juanfeSanahuja <85166064+juanfeSanahuja@users.noreply.github.com>
1 parent 6ae448a commit ca11f41

File tree

3 files changed

+212
-1
lines changed

3 files changed

+212
-1
lines changed

MIGRATION_INSTRUCTIONS.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Migration Instructions for Composite GitHub Actions
2+
3+
This document provides instructions for completing the migration of composite GitHub Actions from `opencb/java-common-libs` to `opencb/ci-core`.
4+
5+
## What Has Been Done
6+
7+
### 1. Actions Migrated to ci-core Repository
8+
9+
The following composite actions have been successfully copied from the `TASK-8067` branch of `opencb/java-common-libs` to this repository:
10+
11+
- `.github/actions/setup-java-maven/action.yml` - Sets up Java, dependencies, and Maven cache
12+
- `.github/actions/test-summary/action.yml` - Generates and publishes test summaries
13+
14+
These actions are now available in the `opencb/ci-core` repository and can be referenced by other repositories.
15+
16+
### 2. Patch File Created for java-common-libs
17+
18+
A patch file (`java-common-libs-updates.patch`) has been created that contains all the necessary changes to update the workflow files in the `opencb/java-common-libs` repository (branch `TASK-8067`) to reference the migrated actions in `opencb/ci-core`.
19+
20+
## What Needs to Be Done
21+
22+
### Apply the Patch to opencb/java-common-libs
23+
24+
The patch file needs to be applied to the `TASK-8067` branch of the `opencb/java-common-libs` repository. This can be done using one of the following methods:
25+
26+
#### Method 1: Using git apply (Recommended)
27+
28+
```bash
29+
# Clone the repository and checkout the TASK-8067 branch
30+
git clone https://github.com/opencb/java-common-libs.git
31+
cd java-common-libs
32+
git checkout TASK-8067
33+
34+
# Apply the patch
35+
git apply /path/to/java-common-libs-updates.patch
36+
37+
# Review the changes
38+
git diff
39+
40+
# Commit and push the changes
41+
git add .
42+
git commit -m "Update action references to use opencb/ci-core repository"
43+
git push origin TASK-8067
44+
```
45+
46+
#### Method 2: Manual Updates
47+
48+
Alternatively, the following workflow files can be manually updated in the `TASK-8067` branch:
49+
50+
1. `.github/workflows/build-java-app-workflow.yml` - Line 43
51+
- Change: `uses: ./.github/actions/setup-java-maven`
52+
- To: `uses: opencb/ci-core/.github/actions/setup-java-maven@main`
53+
54+
2. `.github/workflows/test-analysis.yml` - Lines 24 and 39
55+
- Change: `uses: ./.github/actions/setup-java-maven`
56+
- To: `uses: opencb/ci-core/.github/actions/setup-java-maven@main`
57+
- Change: `uses: ./.github/actions/test-summary`
58+
- To: `uses: opencb/ci-core/.github/actions/test-summary@main`
59+
60+
3. `.github/workflows/test-xetabase-workflow.yml` - Line 126
61+
- Change: `uses: ./.github/actions/test-summary`
62+
- To: `uses: opencb/ci-core/.github/actions/test-summary@main`
63+
64+
## Summary of Changes
65+
66+
The patch updates 3 workflow files to use the centralized actions:
67+
68+
- **build-java-app-workflow.yml**: 1 reference updated
69+
- **test-analysis.yml**: 2 references updated
70+
- **test-xetabase-workflow.yml**: 1 reference updated
71+
72+
Total: 4 action references now point to `opencb/ci-core/.github/actions/*@main`
73+
74+
## Verification
75+
76+
After applying the patch to the `opencb/java-common-libs` repository:
77+
78+
1. Verify that all workflow files reference the correct actions
79+
2. Test the workflows to ensure they work correctly with the centralized actions
80+
3. Monitor the first few workflow runs to catch any issues early
81+
82+
## Notes
83+
84+
- The actions use `@main` to reference the main branch of the ci-core repository
85+
- If you need to reference a specific version or tag, update the `@main` suffix accordingly
86+
- The actions in ci-core preserve all the original functionality and comments from java-common-libs

README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
11
# ci-core
2-
Core CI/CD components for OpenCB and Xetabase projects. Centralized reusable GitHub Actions, composite actions, and internal workflows implementing our organization’s opinionated build, test, and release rules.
2+
3+
Core CI/CD components for OpenCB and Xetabase projects. Centralized reusable GitHub Actions, composite actions, and internal workflows implementing our organization's opinionated build, test, and release rules.
4+
5+
## Available Composite Actions
6+
7+
### setup-java-maven
8+
9+
**Location:** `.github/actions/setup-java-maven/`
10+
11+
Sets up Java, dependencies, and Maven cache for OpenCB projects.
12+
13+
**Usage:**
14+
```yaml
15+
- name: Setup Java and Maven
16+
uses: opencb/ci-core/.github/actions/setup-java-maven@main
17+
with:
18+
java_version: '11' # Optional, default: '11'
19+
storage_hadoop: 'hdi5.1' # Optional, default: 'hdi5.1'
20+
dependency_repos: 'repo1,repo2' # Optional, default: ''
21+
require_cache_hit: 'false' # Optional, default: 'false'
22+
```
23+
24+
**Inputs:**
25+
- `java_version`: Java version to use (default: "11")
26+
- `storage_hadoop`: Hadoop flavour, used as part of the Maven cache key (default: "hdi5.1")
27+
- `dependency_repos`: Comma-separated list of dependency repositories to clone and compile
28+
- `require_cache_hit`: If true, fail the job when the Maven cache is not found
29+
30+
**Outputs:**
31+
- `dependencies_sha`: Hash representing dependency commits
32+
- `cache-hit`: True if the Maven cache was found
33+
34+
### test-summary
35+
36+
**Location:** `.github/actions/test-summary/`
37+
38+
Generates a Markdown summary of Surefire test results and writes it to GITHUB_STEP_SUMMARY.
39+
40+
**Usage:**
41+
```yaml
42+
- name: Generate Test Summary
43+
uses: opencb/ci-core/.github/actions/test-summary@main
44+
with:
45+
report_paths: './**/surefire-reports/TEST-*.xml' # Optional
46+
title: 'Test Results' # Optional
47+
include_module_table: 'true' # Optional
48+
```
49+
50+
**Inputs:**
51+
- `report_paths`: Glob pattern for Surefire XML reports (default: "./**/surefire-reports/TEST-*.xml")
52+
- `title`: Title for the test summary section (default: "Test summary")
53+
- `include_module_table`: Whether to include the per-module breakdown table (default: "true")
54+
55+
**Outputs:**
56+
- `total_success`: Total number of successful tests
57+
- `total_failed`: Total number of failed tests
58+
- `total_errors`: Total number of tests with errors
59+
- `total_skipped`: Total number of skipped tests
60+
- `total_tests`: Total number of tests
61+
62+
## Migration
63+
64+
See [MIGRATION_INSTRUCTIONS.md](MIGRATION_INSTRUCTIONS.md) for details on migrating actions from other repositories.

java-common-libs-updates.patch

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From 71467d072104c55bf7a1585f4a83253f077ae75f Mon Sep 17 00:00:00 2001
2+
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
3+
Date: Fri, 12 Dec 2025 16:41:30 +0000
4+
Subject: [PATCH] Update action references to use opencb/ci-core repository
5+
6+
---
7+
.github/workflows/build-java-app-workflow.yml | 2 +-
8+
.github/workflows/test-analysis.yml | 4 ++--
9+
.github/workflows/test-xetabase-workflow.yml | 2 +-
10+
3 files changed, 4 insertions(+), 4 deletions(-)
11+
12+
diff --git a/.github/workflows/build-java-app-workflow.yml b/.github/workflows/build-java-app-workflow.yml
13+
index cf7774b..1461fca 100644
14+
--- a/.github/workflows/build-java-app-workflow.yml
15+
+++ b/.github/workflows/build-java-app-workflow.yml
16+
@@ -40,7 +40,7 @@ jobs:
17+
# This step sets up JDK, clones and optionally compiles dependencies,
18+
# and configures the Maven cache for the whole job.
19+
id: setup_java_maven
20+
- uses: ./.github/actions/setup-java-maven
21+
+ uses: opencb/ci-core/.github/actions/setup-java-maven@main
22+
with:
23+
java_version: ${{ inputs.java_version }}
24+
storage_hadoop: ${{ inputs.hadoop_flavour || vars.HADOOP_FLAVOUR }}
25+
diff --git a/.github/workflows/test-analysis.yml b/.github/workflows/test-analysis.yml
26+
index a02a907..4b4fbe9 100644
27+
--- a/.github/workflows/test-analysis.yml
28+
+++ b/.github/workflows/test-analysis.yml
29+
@@ -21,7 +21,7 @@ jobs:
30+
- name: Setup Java and Maven cache
31+
# Reuse the composite action to configure Java and Maven cache
32+
id: setup_java_maven
33+
- uses: ./.github/actions/setup-java-maven
34+
+ uses: opencb/ci-core/.github/actions/setup-java-maven@main
35+
with:
36+
require_cache_hit: true
37+
- name: Start MongoDB v6.0
38+
@@ -36,7 +36,7 @@ jobs:
39+
run: mvn -B verify surefire-report:report --fail-never org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_java-common-libs --no-transfer-progress
40+
- name: Append test summary to job summary
41+
if: success() || failure()
42+
- uses: ./.github/actions/test-summary
43+
+ uses: opencb/ci-core/.github/actions/test-summary@main
44+
with:
45+
report_paths: './**/surefire-reports/TEST-*.xml'
46+
title: "Java tests summary"
47+
\ No newline at end of file
48+
diff --git a/.github/workflows/test-xetabase-workflow.yml b/.github/workflows/test-xetabase-workflow.yml
49+
index d8d573a..1949a1a 100644
50+
--- a/.github/workflows/test-xetabase-workflow.yml
51+
+++ b/.github/workflows/test-xetabase-workflow.yml
52+
@@ -123,7 +123,7 @@ jobs:
53+
cat ./opencga-enterprise/build.log | tee -a $GITHUB_STEP_SUMMARY
54+
- name: Append test summary to job summary
55+
if: success() || failure()
56+
- uses: ./.github/actions/test-summary
57+
+ uses: opencb/ci-core/.github/actions/test-summary@main
58+
with:
59+
report_paths: './**/surefire-reports/TEST-*.xml'
60+
title: "Xetabase tests summary"
61+
--
62+
2.52.0
63+

0 commit comments

Comments
 (0)