-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.8 KB
/
build.yml
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
name: Maven PR Build
# We require all commits go through PR on GitHub
on:
pull_request:
branches:
- webrepl
jobs:
build:
name: Maven PR Builder (JDK ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
matrix:
java: [ "21" ]
maven: [ "3.8.2" ]
steps:
- name: Check out code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
fetch-depth: 0 # Unshallow checkout helps SonarCloud provide more info
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
with:
buildkitd-flags: --debug
- name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@860f60056505705214d223b91ed7a30f173f6142 # v3.3.0
with:
cache: maven
distribution: 'adopt'
java-version: ${{ matrix.java }}
# If running locally in act, install Maven
- name: Set up Maven if needed
if: ${{ env.ACT }}
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
with:
maven-version: ${{ matrix.maven }}
- name: Cache SonarCloud packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOCKER_BUILDKIT: 1
run: mvn -B -ntp -Psonar verify -Dsonar.branch.name="${{ github.ref }}"