Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-1111
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Jul 12, 2023
2 parents 3d47ded + 924664d commit 7aae905
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 90 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
with:
report_context: development
report_dir: ${{ github.ref_name }}/biodata/${{ github.sha }}

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ 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: biodata

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/scripts/get_same_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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"
29 changes: 0 additions & 29 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,3 @@ jobs:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
with:
report_context: development
report_dir: ${{ github.ref_name }}/biodata/${{ github.sha }}

deploy-maven:
name: Deploy in maven only for renamed versions
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: [ build, test ]
if: contains( needs.build.outputs.version ,'TASK')
secrets: inherit

#The following jobs are to see that the previous 'if' doesn't 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 }}
63 changes: 19 additions & 44 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
name: Build and test the project
on:
workflow_call:
inputs:
report_dir:
type: string
required: true
report_context:
type: string
required: true
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
env:
xb_version: "1.7.0"

jobs:
test:
name: Test and push Sonar analysis
Expand All @@ -37,35 +21,26 @@ jobs:
cache: 'maven'
- name: Install Samtools
run: sudo apt-get install samtools
- 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 org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_biodata
- 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: ["biodata-tools", "biodata-models"]
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 org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_biodata
- 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
2 changes: 1 addition & 1 deletion biodata-external/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>biodata</artifactId>
<groupId>org.opencb.biodata</groupId>
<version>2.9.0-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion biodata-formats/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion biodata-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.opencb.biodata.models.core;

import org.opencb.commons.utils.PrintUtils;

import java.util.Set;

public class AnnotationEvidence {
Expand Down
2 changes: 1 addition & 1 deletion biodata-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.opencb.biodata.models.variant.avro.ConsequenceType;
import org.opencb.biodata.models.variant.avro.GeneCancerAssociation;
import org.opencb.biodata.models.variant.avro.SequenceOntologyTerm;
import org.opencb.commons.utils.PrintUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -94,6 +95,7 @@ public ClinicalVariantCreator(List<DiseasePanel> diseasePanels, Disorder disorde
this.modeOfInheritances = modeOfInheritances;
this.penetrance = penetrance;
this.assembly = assembly;
PrintUtils.printSpace();

this.biotypeSet = new HashSet<>();
if (CollectionUtils.isNotEmpty(biotypes)) {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Biodata</name>
<description>Biological entities and their equivalents in different file formats typically used in bioinformatics</description>
Expand All @@ -34,7 +34,7 @@
</modules>

<properties>
<java-common-libs.version>4.9.0-SNAPSHOT</java-common-libs.version>
<java-common-libs.version>4.10.0-SNAPSHOT</java-common-libs.version>
<collections.version>4.4</collections.version>
<avro.version>1.7.7</avro.version>
<protobuf.version>3.11.4</protobuf.version>
Expand Down

0 comments on commit 7aae905

Please sign in to comment.