-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (93 loc) · 3.19 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build and Test
on:
pull_request:
branches:
- master
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
GRADLE_OPTS: -Dorg.gradle.console=plain -Djava.security.egd=file:/dev/./urandom
jobs:
matrix_build:
name: "Matrix Build"
runs-on:
- ubuntu-latest
container:
image: azul/zulu-openjdk:17
strategy:
fail-fast: false
max-parallel: 100
matrix:
spring_boot_version:
- 3.3.1
- 3.2.2
env:
SPRING_BOOT_VERSION: ${{ matrix.spring_boot_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: "Assemble jar"
run: ./gradlew assemble --console=plain --info --stacktrace --parallel
- name: "Compile tests"
run: ./gradlew compileTestJava --console=plain --info --stacktrace --parallel
- name: "Run checks"
run: ./gradlew check -x test --console=plain --stacktrace
- name: "Run tests"
run: ./gradlew -Dspring.profiles.include=continuous-integration test --console=plain --info --stacktrace
- name: "Test if publishing works"
run: ./gradlew publishToMavenLocal --console=plain --info --stacktrace
- name: "Publish Test Report"
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Report-(${{ matrix.spring_boot_version }})
report_paths: '**/build/test-results/**/*.xml'
require_tests: true
- name: Publish checkstyle report
if: always()
uses: lcollins/[email protected]
with:
name: Checkstyle Report-(${{ matrix.spring_boot_version }})
path: '**/build/reports/**/*.xml'
- name: Publish spotbugs report
if: always()
uses: lcollins/[email protected]
with:
name: Spotbugs Report-(${{ matrix.spring_boot_version }})
path: '**/build/reports/**/*.xml'
- name: "Collect test reports"
run: |
tar -zcvf all-test-reports-${{ matrix.spring_boot_version }}.tar.gz **/build/reports
if: always()
- name: "Store test results"
uses: actions/upload-artifact@v4
if: always()
with:
name: all-test-reports-${{ matrix.spring_boot_version }}
path: all-test-reports-${{ matrix.spring_boot_version }}.tar.gz
retention-days: 7
build:
name: "Build and Test"
runs-on:
- ubuntu-latest
needs: matrix_build
steps:
# Needed hacks to properly fail the build when one matrix build fails.
- name: Do something so that GHA is happy
run: echo "Be happy!"
- name: Verify matrix jobs succeeded
if: ${{ needs.matrix_build.result != 'success' }}
run: exit 1
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: "Tag release"
if: github.ref == 'refs/heads/master'
run: ./gradlew tagRelease --console=plain --info --stacktrace