From 8e37dc079f65741de62688cdad50be86bd091445 Mon Sep 17 00:00:00 2001 From: Stian Sandvold Date: Sun, 31 May 2026 08:44:19 +0200 Subject: [PATCH] chore(ci): run dependency:analyze in its own parallel job The unit-test job ran 'mvn dependency:analyze' as a second step after the unit tests. That goal forks its own build up to test-compile, so it recompiled the whole reactor a second time inside unit-test (~1m35s) for a check that has nothing to do with unit tests. Move it into its own 'dependency-analysis' job that runs in parallel on its own runner, off the critical path. The dependency check still runs on every PR and push with the same fail-on-warning behaviour (configured in dhis-2/pom.xml), and the unit-test job no longer pays for the extra recompile. The new job is added to the Slack-on-failure notification's needs so a failure on master is still reported. --- .github/workflows/run-tests.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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: