diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 49d41611e4d7..8bf41647221a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -42,9 +42,6 @@ jobs: - name: Run unit tests run: mvn clean test --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml --activate-profiles unit-test timeout-minutes: 30 - - name: Run dependency analysis - run: mvn dependency:analyze --file ./dhis-2/pom.xml - timeout-minutes: 2 - name: Report coverage to codecov uses: codecov/codecov-action@v3 with: @@ -75,6 +72,24 @@ jobs: surefire_reports.tar retention-days: 5 + # dependency:analyze used to run inside unit-test, but the goal forks its own build up + # to test-compile, so it bolted a second full reactor compile onto the unit-test job + # (~1m35s) for a check unrelated to unit tests. It runs here in its own job instead, in + # parallel and off the critical path, with the same fail-on-warning behaviour. + dependency-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + java-version: 17 + distribution: temurin + cache: maven + - name: Run dependency analysis + run: mvn dependency:analyze --threads 2C --batch-mode --no-transfer-progress --update-snapshots --file ./dhis-2/pom.xml + timeout-minutes: 10 + # The integration-test suite is the slowest part of CI, so it is split across a # matrix of shards that run in parallel, each on its own runner with its own # Testcontainers Postgres. Each shard runs a disjoint, interleaved slice of the @@ -253,7 +268,7 @@ jobs: contains(needs.*.result, 'failure') && github.ref == 'refs/heads/master' - needs: [unit-test, integration-test, integration-h2-test] + needs: [unit-test, integration-test, integration-h2-test, dependency-analysis] steps: - uses: rtCamp/action-slack-notify@v2 env: