diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 06843b40fb..1bfb788fb8 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -5,9 +5,22 @@ on: # this checks should be triggered on pull request, before deployments, and m pull_request: paths-ignore: - 'infra/resources/src/main/res/**' + - '**.md' + types: + # Default types of PR triggers + - opened + - reopened + - synchronize + # Ensures that Sonar check are run once PR is ready + - ready_for_review workflow_call: workflow_dispatch: +# Cancel in-progress runs when a new commit is pushed to the PR +concurrency: + group: pr-checks-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: core-unit-tests: name: Core Unit Tests @@ -146,3 +159,5 @@ jobs: fingerprint-unit-tests, testing-tools ] uses: ./.github/workflows/reusable-sonar-scan.yml + # Only run if the PR ready for review or triggered manually + if: github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' diff --git a/.github/workflows/reusable-run-unit-tests.yml b/.github/workflows/reusable-run-unit-tests.yml index aebbfb5a30..fea7c21877 100644 --- a/.github/workflows/reusable-run-unit-tests.yml +++ b/.github/workflows/reusable-run-unit-tests.yml @@ -60,20 +60,23 @@ jobs: - name: Run tests run: | # Get the modules array from the previous step - modules_array=("${{ steps.create-modules-array.outputs.modules_array}}") - modules_array=(${modules_array// / }) - # Iterate over the array + modules_array=(${{ steps.create-modules-array.outputs.modules_array }}) + # Transform input list into a single string of gradle tasks + TASKS="" for module in "${modules_array[@]}"; do - echo -e "\n\n" - echo "==========================================" - echo "==========================================" - echo " Test $module" - echo "==========================================" - echo "==========================================" - echo -e "\n\n" - ./gradlew $module:jacocoTestReport + if [ -n "$module" ]; then + TASKS="$TASKS $module:jacocoTestReport" + fi done + echo -e "\n\n" + echo "==========================================" + echo "==========================================" + echo "Executing Gradle tasks: $TASKS" + echo "==========================================" + echo "==========================================" + echo -e "\n\n" + ./gradlew $TASKS --continue --no-daemon - name: Upload Folders uses: actions/upload-artifact@v6 with: