diff --git a/.github/scripts/find-modules-with-unit-tests.sh b/.github/scripts/find-modules-with-unit-tests.sh new file mode 100755 index 00000000000..d62896f2c6b --- /dev/null +++ b/.github/scripts/find-modules-with-unit-tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +find . -path '**/src/test/java' -type d \ + | grep -v -E '\./(docs|distribution|misc|operator|tests|testsuite|test-framework|quarkus)/' \ + | sed 's|/src/test/java||' \ + | sed 's|./||' \ + | sort \ + | tr '\n' ',' \ + | sed 's/,$//' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c584064dd9..17f54e78ceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,14 +114,7 @@ jobs: - name: Run unit tests run: | - SEP="" - PROJECTS="" - for i in `find -name '*Test.java' -type f | egrep -v './(operator|testsuite|quarkus|docs|tests|test-framework)/' | sed 's|/src/test/java/.*||' | sort | uniq | sed 's|./||'`; do - PROJECTS="$PROJECTS$SEP$i" - SEP="," - done - - ./mvnw test -pl "$PROJECTS" -am + ./mvnw test -am -pl "$(.github/scripts/find-modules-with-unit-tests.sh)" base-integration-tests: name: Base IT @@ -292,7 +285,7 @@ jobs: ./mvnw test -pl quarkus/tests/integration ${PARAMS["${{ matrix.suite }}"]} 2>&1 | misc/log/trimmer.sh jdk-integration-tests: - name: Java Distribution IT + name: Java Distribution IT/UT needs: build timeout-minutes: 100 strategy: @@ -332,6 +325,10 @@ jobs: run: ./mvnw install -e -DskipTests -DskipExamples -DskipProtoLock=true + - name: Run unit tests + run: | + ./mvnw test -pl "$(.github/scripts/find-modules-with-unit-tests.sh)" + - uses: ./.github/actions/upload-flaky-tests name: Upload flaky tests env: