Skip to content

Commit

Permalink
Merge branch 'release-3.2.x' into TASK-6708
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Sep 3, 2024
2 parents 3412c6b + 8bc7529 commit 58db895
Show file tree
Hide file tree
Showing 1,037 changed files with 42,608 additions and 43,474 deletions.
74 changes: 60 additions & 14 deletions .github/workflows/check-junit-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
name: Check junits
run-name: "Check Junit. Hadoop ${{ inputs.hadoop }} ${{ inputs.module == 'all' && ' ' || format(':{0}. ', inputs.module ) }}${{ inputs.short_tests && 'Short ' || '' }}${{ inputs.medium_tests && 'Medium ' || '' }}${{ inputs.long_tests && 'Long ' || '' }}${{ ! ( inputs.short_tests || inputs.medium_tests || inputs.long_tests ) && 'Short Medium Long ' || '' }}tests."

on:
workflow_dispatch:
inputs:
hadoop:
type: choice
description: 'Hadoop flavour.'
required: false
default: "hdp3.1"
options:
- "all"
- "hdp3.1"
- "hdi5.1"
- "emr6.1"
- "emr6.13"
module:
type: choice
description: 'OpenCGA module to test.'
required: false
default: "all"
options:
- "all"
- "opencga-analysis"
- "opencga-app"
- "opencga-catalog"
- "opencga-client"
- "opencga-core"
- "opencga-master"
- "opencga-server"
- "opencga-storage"
- "opencga-test"
short_tests:
type: boolean
required: false
Expand All @@ -25,31 +53,49 @@ jobs:
name: Test JUnit
runs-on: ubuntu-22.04
outputs:
profiles: ${{ steps.getter.outputs.profiles }}
profiles: ${{ steps.validate.outputs.profiles }}
modules: ${{ steps.validate.outputs.modules }}
hadoop: ${{ steps.validate.outputs.hadoop }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '10'
- name: Building string profiles to run
id: getter
id: validate
run: |
if [ -f "./.github/workflows/scripts/get_profiles.sh" ]; then
chmod +x ./.github/workflows/scripts/get_profiles.sh
echo "profiles=$(./.github/workflows/scripts/get_profiles.sh ${{ inputs.short_tests }} ${{ inputs.medium_tests }} ${{ inputs.long_tests }})" >> $GITHUB_OUTPUT
profiles=$(./.github/workflows/scripts/get_profiles.sh ${{ inputs.short_tests }} ${{ inputs.medium_tests }} ${{ inputs.long_tests }})
modules='["${{ inputs.module }}"]'
hadoop='["${{ inputs.hadoop }}"]'
if [ "${{ inputs.hadoop }}" == "all" ]; then
hadoop='["hdp3.1", "hdi5.1", "emr6.1", "emr6.13"]'
elif [ "${{ inputs.module }}" == "all" ]; then
# Only execute modules with matrix strategy if we are testing one single hadoop profile
modules='["opencga-analysis", "opencga-app", "opencga-catalog", "opencga-client", "opencga-core", "opencga-master", "opencga-server", "opencga-storage", "opencga-test"]'
fi
echo "profiles=[\"$profiles\"]" >> $GITHUB_OUTPUT
echo "modules=$modules" >> $GITHUB_OUTPUT
echo "hadoop=$hadoop" >> $GITHUB_OUTPUT
echo "Executing testing profiles -> $profiles" >> $GITHUB_STEP_SUMMARY
echo "Modules -> $modules" >> $GITHUB_STEP_SUMMARY
echo "Hadoop -> $hadoop" >> $GITHUB_STEP_SUMMARY
#echo "matrix={\"hadoop\": $hadoop, \"modules\": $modules}" >> $GITHUB_OUTPUT
fi
echo_log:
needs: get_profiles
runs-on: ubuntu-22.04
steps:
- name: Echo profiles
id: log
run: echo "Executing testing profiles -> ${{ needs.get_profiles.outputs.profiles }}"

test:
needs: [ get_profiles, echo_log ]
strategy:
fail-fast: false
matrix:
hadoop: ${{ fromJson(needs.get_profiles.outputs.hadoop) }}
module: ${{ fromJson(needs.get_profiles.outputs.modules) }}
profile: ${{ fromJson(needs.get_profiles.outputs.profiles) }}
needs: [ get_profiles ]
uses: ./.github/workflows/test-analysis.yml
with:
test_profile: ${{ needs.get_profiles.outputs.profiles }}
test_profile: ${{ matrix.profile }}
hadoop: ${{ matrix.hadoop }}
module: ${{ matrix.module }}
mvn_opts: ${{ inputs.mvn_opts }}
sonar: false
secrets: inherit
21 changes: 11 additions & 10 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
maven_opts: -P storage-hadoop,hdp3.1,RClient,opencga-storage-hadoop-deps -Dopencga.war.name=opencga -Dcheckstyle.skip -pl '!:opencga-storage-hadoop-deps-emr6.1,!:opencga-storage-hadoop-deps-hdp2.6'
maven_opts: -Phdp3.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
with:
test_profile: runShortTests,runMediumTests
secrets: inherit
## TASK-4970: remove the test job from the develop.yml workflow because it is not needed anymore.
# test:
# uses: ./.github/workflows/test-analysis.yml
# needs: build
# with:
# test_profile: runShortTests,runMediumTests
# secrets: inherit

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
needs: build
with:
maven_opts: -P storage-hadoop,hdp3.1 -Dopencga.war.name=opencga
maven_opts: -P hdp3.1 -Dopencga.war.name=opencga
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,init
secrets: inherit
20 changes: 0 additions & 20 deletions .github/workflows/docker-aws-emr.yml

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/long-test-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ on:

jobs:
test:
strategy:
fail-fast: false
matrix:
hadoop: [ "hdp3.1", "hdi5.1", "emr6.1", "emr6.13" ]
uses: ./.github/workflows/test-analysis.yml
secrets: inherit
with:
test_profile: runShortTests,runMediumTests,runLongTests,

test_profile: runShortTests,runMediumTests,runLongTests
hadoop: ${{ matrix.hadoop }}
secrets: inherit

17 changes: 13 additions & 4 deletions .github/workflows/manual-deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ on:
description: "The tag for the new docker."
type: string
required: true
hadoop:
type: choice
description: 'Hadoop flavour. Any of: [hdp3.1, hdi5.1, emr6.1, emr6.13]'
required: false
default: hdp3.1
options:
- hdp3.1
- hdi5.1
- emr6.1
- emr6.13

jobs:
build:
Expand All @@ -32,19 +42,18 @@ jobs:
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 }}
./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }} ${{ inputs.hadoop }}
fi
- name: Maven Build (skip tests)
run: mvn -T 2 clean install -DskipTests -P storage-hadoop,hdp3.1,RClient,opencga-storage-hadoop-deps -Dopencga.war.name=opencga -Dcheckstyle.skip -pl '!:opencga-storage-hadoop-deps-emr6.1,!:opencga-storage-hadoop-deps-hdp2.6'
run: mvn -T 2 clean install -DskipTests -P${{ inputs.hadoop }} -Dopencga.war.name=opencga -Dcheckstyle.skip
- uses: actions/upload-artifact@v4
with:
name: build-folder
path: build


deploy-docker:
uses: opencb/java-common-libs/.github/workflows/deploy-docker-hub-workflow.yml@develop
needs: build
with:
cli: python3 ./build/cloud/docker/docker-build.py push --images base,init --tag ${{ inputs.tag }}
secrets: inherit
secrets: inherit
9 changes: 6 additions & 3 deletions .github/workflows/manual-deploy-ext-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
description: "The tag for the new docker."
type: string
required: true
hadoop:
type: string
description: 'Hadoop flavour. Any of: [hdp3.1, hdi5.1, emr6.1, emr6.13]'
required: false
default: "hdp3.1"

jobs:
build:
Expand All @@ -32,7 +37,7 @@ jobs:
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 }}
./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }} ${{ inputs.hadoop }}
fi
- name: Maven Build (skip tests)
run: mvn -T 2 clean install -DskipTests
Expand All @@ -41,11 +46,9 @@ jobs:
name: build-folder
path: build


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

35 changes: 35 additions & 0 deletions .github/workflows/pull-request-approved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pull request approve workflow
run-name: 'Pull request approve workflow ${{ github.event.pull_request.head.ref }} -> ${{ github.event.pull_request.base.ref }} by @${{ github.actor }}'

on:
pull_request_review:
types: [ submitted ]

jobs:
calculate-xetabase-branch:
name: Calculate Xetabase branch
runs-on: ubuntu-22.04
outputs:
xetabase_branch: ${{ steps.get_xetabase_branch.outputs.xetabase_branch }}
steps:
- name: Clone project
uses: actions/checkout@v4
with:
fetch-depth: '10'
- id: get_xetabase_branch
name: "Get current branch for Xetabase from target branch"
run: |
chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.base.ref }})
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
test:
name: "Run all tests before merging"
needs: calculate-xetabase-branch
uses: opencb/java-common-libs/.github/workflows/test-xetabase-workflow.yml@TASK-6399
with:
branch: ${{ needs.calculate-xetabase-branch.outputs.xetabase_branch }}
task: ${{ github.event.pull_request.head.ref }}
secrets: inherit

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
maven_opts: -P storage-hadoop,hdp3.1,RClient,opencga-storage-hadoop-deps -Dopencga.war.name=opencga -Dcheckstyle.skip -pl '!:opencga-storage-hadoop-deps-emr6.1,!:opencga-storage-hadoop-deps-hdp2.6'
maven_opts: -P hdp3.1,RClient -Dopencga.war.name=opencga -Dcheckstyle.skip

delete-docker:
uses: opencb/java-common-libs/.github/workflows/delete-docker-hub-workflow.yml@develop
Expand Down
Loading

0 comments on commit 58db895

Please sign in to comment.