Skip to content

Commit d7cf9eb

Browse files
committed
chore: reduce unnecessary test runs in verify_build workflow
1 parent 2abb380 commit d7cf9eb

2 files changed

Lines changed: 40 additions & 26 deletions

File tree

.github/workflows/release_with_jars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
uses: actions/setup-java@v5
7878
with:
7979
distribution: 'temurin'
80-
java-version: '17'
80+
java-version: '21'
8181
cache: 'maven'
8282
- name: Build java 17 version with Maven, do not test
8383
run: mvn -B package --file pom.xml -DskipTests -Djacoco.skip=true

.github/workflows/verify_build.yml

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313
- master
1414

1515
jobs:
16-
test_java:
17-
name: Assert tests and javadoc with Java 21 on Ubuntu
16+
test_javadoc:
17+
name: Assert javadoc with Java 21 on Ubuntu
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v6
@@ -29,9 +29,40 @@ jobs:
2929
cache: 'maven'
3030
- name: Generate javadoc
3131
run: mvn javadoc:javadoc "-Daether.connector.basic.retries=5"
32+
33+
test_java_matrix:
34+
name: Assert tests with Java 21 on ${{ matrix.platform }}
35+
runs-on: ${{ matrix.os }}
36+
needs: test_javadoc
37+
strategy:
38+
fail-fast: true
39+
matrix:
40+
include:
41+
- platform: Ubuntu
42+
os: ubuntu-latest
43+
verify_jacoco: true
44+
- platform: Windows
45+
os: windows-latest
46+
verify_jacoco: false
47+
steps:
48+
- uses: actions/checkout@v6
49+
with:
50+
token: ${{ github.token }}
51+
fetch-depth: 1
52+
- name: Set up Java 21 environment
53+
uses: actions/setup-java@v5
54+
with:
55+
distribution: 'temurin'
56+
java-version: '21'
57+
cache: 'maven'
3258
- name: Run tests and generate JaCoCo report
33-
run: mvn -B test --file pom.xml -ntp -DskipITs -DexcludedGroups=slow "-Daether.connector.basic.retries=5"
59+
if: matrix.verify_jacoco
60+
run: mvn -B test -ntp -DexcludedTestGroups= "-Daether.connector.basic.retries=5"
61+
- name: Run fast tests, do not generate JaCoCo report
62+
if: ${{ !matrix.verify_jacoco }}
63+
run: mvn -B test -ntp -DskipITs "-Daether.connector.basic.retries=5" -Djacoco.skip=true
3464
- name: Verify JaCoCo report exists
65+
if: matrix.verify_jacoco && github.event_name == 'push' && github.ref == 'refs/heads/master'
3566
run: |
3667
if [ -f target/site/jacoco/jacoco.xml ]; then
3768
echo "JaCoCo report found"
@@ -45,7 +76,7 @@ jobs:
4576
exit 1
4677
fi
4778
- name: Upload jacoco coverage reports to Codecov
48-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
79+
if: matrix.verify_jacoco && github.event_name == 'push' && github.ref == 'refs/heads/master'
4980
uses: codecov/codecov-action@v6
5081
with:
5182
files: target/site/jacoco/jacoco.xml
@@ -56,7 +87,7 @@ jobs:
5687
test_java_8:
5788
name: Assert tests with Java 8 on Ubuntu
5889
runs-on: ubuntu-latest
59-
needs: test_java
90+
needs: test_java_matrix
6091
steps:
6192
- uses: actions/checkout@v6
6293
with:
@@ -69,12 +100,12 @@ jobs:
69100
java-version: '8'
70101
cache: 'maven'
71102
- name: Run tests
72-
run: mvn -B test --file pomJava8.xml -ntp "-Daether.connector.basic.retries=5"
103+
run: mvn -B test --file pomJava8.xml -ntp "-Daether.connector.basic.retries=5" -Djacoco.skip=true
73104

74105
test_java_8_windows:
75106
name: Assert tests with Java 8 on Windows
76107
runs-on: windows-latest
77-
needs: test_java_windows
108+
needs: test_java_matrix
78109
steps:
79110
- uses: actions/checkout@v6
80111
with:
@@ -87,24 +118,7 @@ jobs:
87118
java-version: '8'
88119
cache: 'maven'
89120
- name: Run tests
90-
run: mvn -B test --file pomJava8.xml -ntp "-Daether.connector.basic.retries=5"
91-
92-
test_java_windows:
93-
name: Assert tests with Java 21 on Windows
94-
runs-on: windows-latest
95-
steps:
96-
- uses: actions/checkout@v6
97-
with:
98-
token: ${{ github.token }}
99-
fetch-depth: 1
100-
- name: Set up Java 21 environment
101-
uses: actions/setup-java@v5
102-
with:
103-
distribution: 'temurin'
104-
java-version: '21'
105-
cache: 'maven'
106-
- name: Run tests
107-
run: mvn -B test --file pom.xml -ntp -DexcludedGroups=slow "-Daether.connector.basic.retries=5"
121+
run: mvn -B test --file pomJava8.xml -ntp "-Daether.connector.basic.retries=5" -Djacoco.skip=true
108122

109123
verify_agent_skills:
110124
name: Verify agent-skill cross-references

0 commit comments

Comments
 (0)