Check Junit. Hadoop all Short tests. #387
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: "hdi5.1" | |
| options: | |
| - "all" | |
| - "hbase2.0" | |
| - "hdi5.1" | |
| - "emr6.1" | |
| - "emr6.13" | |
| - "emr7.5" | |
| 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: | |
| description: 'Run short tests.' | |
| type: boolean | |
| required: false | |
| default: true | |
| medium_tests: | |
| description: 'Run medium tests.' | |
| type: boolean | |
| required: false | |
| default: false | |
| long_tests: | |
| description: 'Run long tests.' | |
| type: boolean | |
| required: false | |
| default: false | |
| mvn_opts: | |
| description: 'Maven options.' | |
| type: string | |
| required: false | |
| default: "" | |
| jobs: | |
| get_profiles: | |
| name: Test JUnit | |
| runs-on: ${{ vars.UBUNTU_VERSION }} | |
| outputs: | |
| 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: validate | |
| run: | | |
| if [ -f "./.github/workflows/scripts/get_profiles.sh" ]; then | |
| chmod +x ./.github/workflows/scripts/get_profiles.sh | |
| 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='["hdi5.1", "emr6.1", "emr6.13", "emr7.5", "hbase2.0"]' | |
| 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 | |
| test: | |
| 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: ${{ matrix.profile }} | |
| hadoop: ${{ matrix.hadoop }} | |
| module: ${{ matrix.module }} | |
| mvn_opts: ${{ inputs.mvn_opts }} | |
| sonar: false | |
| secrets: inherit |