Skip to content

Commit

Permalink
cicd: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
j-coll committed Feb 20, 2024
1 parent a9ffa0c commit eeed2f1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/check-junit-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Check junits
run-name: "Check Junit tests. Hadoop flavour: ${{ inputs.hadoop }}. ${{ 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."
run-name: "Check Junit tests. Hadoop ${{ inputs.hadoop }}. ${{ inputs.module == 'all' && '' || format('Module {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:
Expand All @@ -14,6 +14,18 @@ on:
- "hdi5.1"
- "emr6.1"
- "emr6.13"
module:
type: choice
description: 'OpenCGA module to test.'
required: false
default: "all"
options:
- "all"
- "opencga-core"
- "opencga-catalog"
- "opencga-storage"
- "opencga-analysis"
- "opencga-master"
short_tests:
type: boolean
required: false
Expand Down Expand Up @@ -42,26 +54,20 @@ jobs:
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 }})
echo "profiles=$profiles" >> $GITHUB_OUTPUT
echo "Executing testing profiles -> $profiles" >> $GITHUB_STEP_SUMMARY
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 ]
needs: [ get_profiles ]
uses: ./.github/workflows/test-analysis.yml
with:
test_profile: ${{ needs.get_profiles.outputs.profiles }}
mvn_opts: ${{ inputs.mvn_opts }}
hadoop: ${{ inputs.hadoop }}
module: ${{ inputs.module }}
secrets: inherit
9 changes: 8 additions & 1 deletion .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
type: string
required: false
default: ""
module:
type: string
description: "Maven modules to test. Empty means all. Only top-level modules. Example: 'opencga-storage'"
required: false
default: ""
secrets:
SONAR_TOKEN:
required: true
Expand Down Expand Up @@ -77,8 +82,10 @@ jobs:
with:
mongodb-version: 6.0
mongodb-replica-set: rs-test
- name: Maven build
run: mvn -B clean install -DskipTests -P ${{ inputs.hadoop }} -Dcheckstyle.skip ${{ inputs.mvn_opts }}
- name: Run Junit tests
run: mvn -B verify surefire-report:report --fail-never -P ${{ inputs.hadoop }},${{ inputs.test_profile }} -Dcheckstyle.skip ${{ inputs.mvn_opts }}
run: mvn -B verify surefire-report:report --fail-never -f ${{ (inputs.module == '' || inputs.model == 'all') && '.' || inputs.module }} -P ${{ inputs.hadoop }},${{ inputs.test_profile }} -Dcheckstyle.skip ${{ inputs.mvn_opts }}
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
env:
Expand Down

0 comments on commit eeed2f1

Please sign in to comment.