Skip to content

Commit a505f0e

Browse files
committed
Align GHA for main and pull-request
Align GHA for main and pull-request by: - defining continue-on-error to true for main gha - by adding -Dstyle.color=always to all runs - only run Sonatype step if deploy-enabled is true - defining fail-fast to false pull request gha
1 parent 25da9c0 commit a505f0e

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
build:
1111
name: Test and Build on JDK ${{ matrix.java-version }}
1212
runs-on: ubuntu-latest
13+
continue-on-error: true # do not fail the whole job if one of the steps fails
14+
1315
strategy:
1416
matrix:
1517
include:
@@ -21,7 +23,7 @@ jobs:
2123
uses: actions/checkout@v3
2224

2325
- name: Set up JDK ${{ matrix.java-version }}
24-
uses: actions/setup-java@v3
26+
uses: actions/setup-java@v3.5.0
2527
with:
2628
distribution: 'zulu'
2729
java-version: ${{ matrix.java-version }}
@@ -33,17 +35,17 @@ jobs:
3335
- name: Regular Build
3436
if: ${{ !matrix.sonar-enabled }}
3537
run: |
36-
./mvnw -B -U clean verify
38+
./mvnw -B -U -Dstyle.color=always clean verify
3739
3840
- name: Build with Coverage reports
3941
if: matrix.sonar-enabled
4042
run: |
41-
./mvnw -B -U -Dcoverage clean verify
43+
./mvnw -B -U -Dstyle.color=always -Dcoverage clean verify
4244
4345
- name: Sonar Analysis
4446
if: matrix.sonar-enabled
4547
run: |
46-
./mvnw -B sonar:sonar \
48+
./mvnw -B -Dstyle.color=always sonar:sonar \
4749
-Dsonar.projectKey=AxonFramework_extension-spring-native \
4850
-Dsonar.organization=axonframework \
4951
-Dsonar.host.url=https://sonarcloud.io \
@@ -52,9 +54,9 @@ jobs:
5254
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5355

5456
- name: Deploy to Sonatype
55-
if: success()
57+
if: success() && ${{ matrix.deploy-enabled }}
5658
run: |
57-
./mvnw -B -U deploy -DskipTests=true
59+
./mvnw -B -U -Dstyle.color=always deploy -DskipTests=true
5860
env:
5961
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6062
MAVEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_ID }}

.github/workflows/pullrequest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/checkout@v3
1919

2020
- name: Set up JDK ${{ matrix.java-version }}
21-
uses: actions/setup-java@v3
21+
uses: actions/setup-java@v3.5.0
2222
with:
2323
distribution: 'zulu'
2424
java-version: ${{ matrix.java-version }}
@@ -30,17 +30,17 @@ jobs:
3030
- name: Regular Build
3131
if: ${{ !matrix.sonar-enabled }}
3232
run: |
33-
./mvnw -B -U clean verify
33+
./mvnw -B -U -Dstyle.color=always clean verify
3434
3535
- name: Build with Coverage reports
3636
if: matrix.sonar-enabled
3737
run: |
38-
./mvnw -B -U -Dcoverage clean verify
38+
./mvnw -B -U -Dstyle.color=always -Possrh -Dcoverage clean verify
3939
4040
- name: Sonar Analysis
4141
if: ${{ success() && matrix.sonar-enabled && github.event.pull_request.head.repo.full_name == github.repository }}
4242
run: |
43-
./mvnw -B sonar:sonar \
43+
./mvnw -B -Dstyle.color=always sonar:sonar \
4444
-Dsonar.projectKey=AxonFramework_extension-spring-native \
4545
-Dsonar.organization=axonframework \
4646
-Dsonar.host.url=https://sonarcloud.io \

0 commit comments

Comments
 (0)