forked from eclipse-ee4j/cargotracker
-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (76 loc) · 2.29 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: build
on:
push:
paths-ignore:
- "docs/**"
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
# Recommended: latest versions of Google Java Format require JDK 11+
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--aosp --skip-reflowing-long-strings --skip-sorting-imports --replace"
# version: 1.9
# Recommended if you use MacOS:
# githubToken: ${{ secrets.GITHUB_TOKEN }}
# set dry-run and will not commit by default
# skipCommit: false
build:
runs-on: ubuntu-latest
needs: [ formatting ]
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: |
mvn clean package --file pom.xml
coverage:
runs-on: ubuntu-latest
needs: [ formatting, build ]
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Set up Database
run: |
docker-compose up -d postgres
sleep 5
docker ps -a
- name: Build with Maven
run: |
mvn clean package
mvn verify -Parq-wildfly-managed,coverage jacoco:report \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.organization=hantsy \
-Dsonar.projectKey=hantsy_cargotracker \
-Dsonar.coverage.exclusions=**/dto/*,**/*Configuration.*,**/SampleDataGenerator.*