-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.62 KB
/
maven.yml
File metadata and controls
57 lines (51 loc) · 1.62 KB
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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 15 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Compile with Maven
run: mvn -T 1C clean generate-sources compile --file pom.xml
test:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 15 ]
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Set up JDK for tests
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Test with Maven
run: mvn -T 1C test-compile test --file pom.xml
sonarcloud:
environment: sonarcloud
runs-on: ubuntu-latest
needs: [build, test]
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11 for sonarcloud
uses: actions/setup-java@v1
with:
java-version: 11
- name: SonarCloud Scan
run: mvn clean test jacoco:report org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar -Dsonar.projectKey=java-fluent-validator-predicates -Dsonar.organization=mvallim -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}