-
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 1.82 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
name: build
on:
push:
branches:
- main
tags:
- '**'
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 17 ]
name: Build with JDK ${{matrix.java}}
steps:
- uses: actions/checkout@v2
name: Checkout
- uses: actions/setup-java@v1
name: Setup JDK ${{matrix.java}}
with:
java-version: ${{matrix.java}}
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Maven build
run: mvn -B -Plegacy verify --file pom.xml
quality:
if: ${{ github.repository == 'xlate/yaml-json' && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
name: Verify Quality
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow --tags --force
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: SonarCloud Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar