diff --git a/.github/actions/run-tests-and-upload-results/action.yml b/.github/actions/run-tests-and-upload-results/action.yml index 0ce38962..315d0753 100644 --- a/.github/actions/run-tests-and-upload-results/action.yml +++ b/.github/actions/run-tests-and-upload-results/action.yml @@ -28,7 +28,7 @@ runs: shell: bash - name: 'Runs the integration tests' if: ${{ inputs.RUN_UNIT_TESTS == 'false' }} - run: mvn -Djacoco.haltOnFailure=false verify -P it --file ${{ inputs.MODULE_DIR }}/pom.xml + run: mvn -Djacoco.haltOnFailure=false integration-test -P it --file ${{ inputs.MODULE_DIR }}/pom.xml shell: bash - name: 'Set environment variables' run: | diff --git a/.github/workflows/parent-build.yml b/.github/workflows/parent-build.yml index a9bdce0f..04d47418 100644 --- a/.github/workflows/parent-build.yml +++ b/.github/workflows/parent-build.yml @@ -67,10 +67,6 @@ jobs: run: cp README.md ${{ env.STAGING_DIR }} - name: 'Copy the `LICENSE` file to `${{ env.STAGING_DIR }}` folder' run: cp LICENSE ${{ env.STAGING_DIR }} - - name: 'Log ${{ env.UPLOADED_ARTIFACTS_DIR }} folder' - run: ls -lart ${{ env.UPLOADED_ARTIFACTS_DIR }} - - name: 'Log ${{ env.STAGING_DIR }} folder' - run: ls -lart ${{ env.STAGING_DIR }} - name: 'Deploy to GitHub Pages' if: ${{ github.ref == 'refs/heads/master' }} uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.github/workflows/putting-all-together.yml b/.github/workflows/putting-all-together.yml index 2a520342..8d6cbdf3 100644 --- a/.github/workflows/putting-all-together.yml +++ b/.github/workflows/putting-all-together.yml @@ -68,12 +68,45 @@ jobs: UPLOADED_ARTIFACTS_DIR: ${{ env.UPLOADED_ARTIFACTS_DIR }} MODULE_DIR: ${{ env.MODULE_DIR }} - generate-project-site: + generate-combined-coverage-report: runs-on: ubuntu-latest needs: - unit-tests - integration-tests + steps: + - name: 'Get the latest code from the `${{ github.repository }}` repository' + uses: actions/checkout@v3 + - name: 'Set up the Oracle JDK `${{ env.JAVA_VERSION }}`' + uses: './.github/actions/install-java' + with: + JAVA_VERSION_TO_INSTALL: ${{ env.JAVA_VERSION }} + - name: 'Download the ut and it test results to generate the combined coverage report' + # this step should be in a separate job which should depend on both ut and it + # so both of them are available to generate the combine coverage report + uses: actions/download-artifact@v3 + with: + path: ${{ env.MODULE_DIR }}/target }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R + working-directory: ${{ env.MODULE_DIR }}/target }} + - name: 'Log files in target directory' + run: ls -lart ${{ env.MODULE_DIR }} }} + - name: 'Generate the merged code coverage report' + run: mvn -Djacoco.haltOnFailure=false post-integration-test -P nt --file ${{ env.MODULE_DIR }}/pom.xml + - name: 'Uploads the results to ${{ env.UPLOAD_DIR }} folder' + uses: actions/upload-artifact@v3 + with: + name: ${{ env.UPLOAD_DIR }} + retention-days: 1 + path: ${{ inputs.MODULE_DIR }}/target + + generate-project-site: + runs-on: ubuntu-latest + needs: generate-combined-coverage-report + steps: - name: 'Get the latest code from the `${{ github.repository }}` repository' uses: actions/checkout@v3 @@ -142,13 +175,6 @@ jobs: mkdir -p ${{ env.SITE_DIR }}/jacoco-merged/jacoco-resources/badges cp ${{ env.UPLOADED_ARTIFACTS_DIR }}/svgs/* ${{ env.SITE_DIR }}/jacoco-merged/jacoco-resources/badges rm -rf ${{ env.UPLOADED_ARTIFACTS_DIR }}/svgs -# - name: 'Create `INDIVIDUAL_MODULES` folder and place it in `${{ env.SITE_DIR }}` with site contents' -# #Adding a new `INDIVIDUAL_MODULES` folder inside `site` folder to contain individual modules deployed site. -# #It's just to avoid the overwriting of the contents deployed by the `parent pom` in the `gh-pages` branch. -# run: | -# mkdir -p INDIVIDUAL_MODULES/${{ env.MODULE_DIR }} -# mv ${{ env.SITE_DIR }}/* INDIVIDUAL_MODULES/${{ env.MODULE_DIR }} -# mv INDIVIDUAL_MODULES ${{ env.SITE_DIR }} - name: 'Deploy to GitHub Pages' if: ${{ github.ref == 'refs/heads/master' }} uses: JamesIves/github-pages-deploy-action@v4