Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-2095
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Oct 11, 2023
2 parents 9c405dc + 81276f6 commit a83173b
Show file tree
Hide file tree
Showing 148 changed files with 6,092 additions and 2,819 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ on:
jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
maven_opts: -DCELLBASE.WAR.NAME=cellbase -P default-config-test

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
with:
report_context: development
report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }}

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
Expand All @@ -32,4 +31,3 @@ jobs:
with:
cli: python3 ./build/cloud/docker/docker-build.py push --images base
secrets: inherit

6 changes: 2 additions & 4 deletions .github/workflows/pull-request-merge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Merge Workflow"
name: "Pull Request Merge Workflow"

on:
pull_request:
Expand All @@ -13,6 +13,4 @@ jobs:
uses: opencb/java-common-libs/.github/workflows/delete-docker-hub-workflow.yml@develop
with:
cli: python3 ./build/cloud/docker/docker-build.py delete --images base --tag ${{ github.head_ref }}
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
secrets: inherit
14 changes: 4 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,26 @@ on:
jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
with:
report_context: xetabase
report_dir: cellbase
maven_opts: -DCELLBASE.WAR.NAME=cellbase

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
needs: build
with:
maven_opts: -Dcheckstyle.skip -DCELLBASE.WAR.NAME=cellbase
secrets: inherit

deploy-docker:
uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop
needs: test
needs: build
with:
cli: python3 ./build/cloud/docker/docker-build.py push --images base
secrets: inherit

deploy-python:
uses: opencb/java-common-libs/.github/workflows/deploy-python-workflow.yml@develop
needs: test
needs: build
with:
cli: bash ./clients/python/python-build.sh push
artifact: build-folder
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/scripts/get_same_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

BRANCH_NAME=$1

if [[ -z $BRANCH_NAME ]]; then
echo "The first parameter is mandatory and must be a valid branch name."
exit 1
fi

if [[ $BRANCH_NAME != "TASK-"* ]]; then
echo "No need to check dependencies."
exit 0
fi

function install(){
local REPO=$1
cd /home/runner/work/ || exit 2
git clone https://github.com/opencb/"$REPO".git -b "$BRANCH_NAME"
if [ -d "./$REPO" ]; then
cd "$REPO" || exit 2
echo "Branch name $BRANCH_NAME already exists."
mvn clean install -DskipTests
else
echo "$CURRENT Branch is NOT EQUALS $BRANCH_NAME "
fi
}

install "java-common-libs"
install "biodata"
35 changes: 3 additions & 32 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,21 @@ on:
branches:
- TASK-*
workflow_dispatch:

jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
maven_opts: -DCELLBASE.WAR.NAME=cellbase -P default-config-test

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
with:
report_context: development
report_dir: ${{ github.ref_name }}/cellbase/${{ github.sha }}

deploy-docker:
uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop
needs: test
with:
cli: python3 ./build/cloud/docker/docker-build.py push --images base --tag ${{ github.ref_name }}
secrets: inherit

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: [ build, test ]
with:
maven_opts: -Dcheckstyle.skip -DCELLBASE.WAR.NAME=cellbase
if: contains( needs.build.outputs.version ,'TASK')
secrets: inherit

#The following jobs are to see that the previous if does not fail and that the maven deploy is executed because it is true
snapshot-version:
name: Check SNAPSHOT version
needs: [ build, test ]
if: contains(needs.build.outputs.version ,'SNAPSHOT')
runs-on: ubuntu-22.04
steps:
- name: test-version-from-check
run: echo "Project version is " ${{ needs.build.outputs.version }}

task-version:
name: Check TASK version
needs: [ build, test ]
if: contains(needs.build.outputs.version ,'TASK')
runs-on: ubuntu-22.04
steps:
- name: test-version-from-check
run: echo "Project version is " ${{ needs.build.outputs.version }}

65 changes: 20 additions & 45 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
name: Build and test the project

on:
workflow_call:
secrets:
SONAR_TOKEN:
required: true
SSH_TESTING_SERVER_HOST:
required: true
SSH_TESTING_SERVER_PORT:
required: true
SSH_TESTING_SERVER_USER:
required: true
SSH_TESTING_SERVER_PASSWORD:
required: true
inputs:
report_dir:
type: string
required: true
report_context:
type: string
required: true
env:
xb_version: "1.7.0"


jobs:
test:
name: Test and push Sonar analysis
Expand All @@ -41,35 +25,26 @@ jobs:
with:
mongodb-version: 6.0
mongodb-replica-set: rs-test
- name: Install dependencies branches
run: |
if [ -f "./.github/workflows/scripts/get_same_branch.sh" ]; then
chmod +x ./.github/workflows/scripts/get_same_branch.sh
./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }}
else
echo "./.github/workflows/scripts/get_same_branch.sh does not exist."
fi
- name: Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify surefire-report:report -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase
- name: Upload result dir
uses: actions/upload-artifact@v3
with:
name: workdir
path: "**/target/site"
publish-test:
name: Publish test results
runs-on: ubuntu-22.04
needs: test
strategy:
matrix:
module: ["cellbase-core", "cellbase-app", "cellbase-client", "cellbase-lib", "cellbase-server"]
steps:
- name: Download result dir
uses: actions/download-artifact@v3
with:
name: workdir
- name: Deploy unit tests web recursively to remote
uses: garygrossgarten/github-action-scp@release
run: mvn -B verify surefire-report:report --fail-never -Dcheckstyle.skip org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_cellbase
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
## Skip cancelled()
## https://docs.github.com/en/actions/learn-github-actions/expressions#cancelled
if: success() || failure()
with:
local: ${{ matrix.module }}/target/site
remote: /var/www/html/reports/${{ inputs.report_context }}/${{ env.xb_version }}/${{ inputs.report_dir }}/unit/${{ matrix.module }}
host: ${{ secrets.SSH_TESTING_SERVER_HOST}}
port: ${{ secrets.SSH_TESTING_SERVER_PORT}}
username: ${{ secrets.SSH_TESTING_SERVER_USER }}
password: ${{ secrets.SSH_TESTING_SERVER_PASSWORD }}
concurrency: 2
check_name: "Surefire tests report"
report_paths: './**/surefire-reports/TEST-*.xml'
commit: '${{ github.sha }}'
fail_on_test_failures: true
5 changes: 3 additions & 2 deletions cellbase-app/app/cloud/docker/cellbase-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Based on Debian 11 (bullseye)
FROM openjdk:11-jre
## Based on Ubuntu 22.04 (jammy)
## We are now using OpenJDK 8u372 to support "cgroup v2", see https://developers.redhat.com/articles/2023/04/19/openjdk-8u372-feature-cgroup-v2-support#
FROM eclipse-temurin:8u372-b07-jre-jammy

LABEL org.label-schema.vendor="OpenCB" \
org.label-schema.name="cellbase-base" \
Expand Down
22 changes: 0 additions & 22 deletions cellbase-app/app/cloud/docker/cellbase-base/Dockerfile.alpine

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
import org.opencb.cellbase.client.config.ClientConfiguration;
import org.opencb.cellbase.core.config.CellBaseConfiguration;
import org.opencb.cellbase.core.exception.CellBaseException;
import org.opencb.commons.utils.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.core.config.Configurator;

import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -204,5 +204,4 @@ protected void makeDir(Path folderPath) throws IOException {
Files.createDirectories(folderPath);
}
}

}
Loading

0 comments on commit a83173b

Please sign in to comment.