3838 --non-recursive org.codehaus.mojo:exec-maven-plugin:3.5.1:exec)
3939 if [[ "$BASE_VER" != *-SNAPSHOT ]]; then
4040 echo "Branch workflow skipped: version '$BASE_VER' is not a SNAPSHOT"
41+ echo "new_version=" >> $GITHUB_OUTPUT
4142 exit 0
4243 fi
4344 # Replace -SNAPSHOT with -SHORT_SHA-RUN_ATTEMPT
@@ -46,10 +47,30 @@ jobs:
4647 echo "new_version=${NEW_VER}" >> $GITHUB_OUTPUT
4748 echo "Using ${NEW_VER}"
4849
50+ tests :
51+ name : Tests
52+ runs-on : ubuntu-latest
53+ needs : prepare
54+ if : ${{ needs.prepare.outputs.new_version != '' }}
55+ steps :
56+ - uses : actions/checkout@v4.1.1
57+ - uses : actions/setup-java@v4.0.0
58+ with :
59+ distribution : ${{ env.JAVA_DISTRIBUTION }}
60+ java-version : ${{ env.JAVA_VERSION }}
61+ cache : maven
62+ - name : Set version
63+ run : mvn -q -DnewVersion="${{ needs.prepare.outputs.new_version }}" -DgenerateBackupPoms=false versions:set
64+ - name : Run reactor tests
65+ run : |
66+ mvn -B -pl '!modules/agent' test
67+ mvn -B -pl modules/agent -DskipNativeBuild=true test
68+
4969 macos :
5070 name : macOS (x86_64 + arm64)
5171 runs-on : macos-14
5272 needs : prepare
73+ if : ${{ needs.prepare.outputs.new_version != '' }}
5374 steps :
5475 - uses : actions/checkout@v4.1.1
5576 - uses : actions/setup-java@v4.0.0
7899 name : Linux (x86_32 + x86_64 + aarch64 cross)
79100 runs-on : ubuntu-22.04
80101 needs : prepare
102+ if : ${{ needs.prepare.outputs.new_version != '' }}
81103 steps :
82104 - uses : actions/checkout@v4.1.1
83105 - uses : actions/setup-java@v4.0.0
@@ -147,6 +169,7 @@ jobs:
147169 name : Windows (x86 + x64)
148170 runs-on : windows-latest
149171 needs : prepare
172+ if : ${{ needs.prepare.outputs.new_version != '' }}
150173 steps :
151174 - uses : actions/checkout@v4.1.1
152175 - uses : actions/setup-java@v4.0.0
@@ -174,7 +197,8 @@ jobs:
174197
175198 deploy-reactor :
176199 name : Deploy non-agent modules
177- needs : [prepare, macos, linux-x, windows-x86]
200+ needs : [prepare, tests, macos, linux-x, windows-x86]
201+ if : ${{ github.event_name == 'push' && needs.prepare.outputs.new_version != '' }}
178202 runs-on : ubuntu-latest
179203 steps :
180204 - uses : actions/checkout@v4.1.1
@@ -210,7 +234,8 @@ jobs:
210234
211235 publish-agent-classifiers :
212236 name : Publish agent POM + native classifiers
213- needs : [prepare, macos, linux-x, windows-x86, deploy-reactor]
237+ needs : [prepare, tests, macos, linux-x, windows-x86, deploy-reactor]
238+ if : ${{ github.event_name == 'push' && needs.prepare.outputs.new_version != '' }}
214239 runs-on : ubuntu-latest
215240 steps :
216241 - uses : actions/checkout@v4.1.1
@@ -277,6 +302,11 @@ jobs:
277302 CLASSIFIERS=""
278303 TYPES=""
279304
305+ if [ -z "$CLASSIFIER_JARS" ]; then
306+ echo "Error: no classifier JARs found to publish"
307+ exit 1
308+ fi
309+
280310 if [ -n "$CLASSIFIER_JARS" ]; then
281311 echo "Found classifier JARs:"
282312 echo "$CLASSIFIER_JARS"
0 commit comments