forked from afs/rdf-delta
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.47 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
80
81
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
gradle:
name: Gradle
if: >
github.event.sender.login != 'dependabot[bot]' ||
( startsWith(github.head_ref, 'dependabot/gradle') )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: build rat jacocoTestReport
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
id: build
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: >
( success() || failure() ) &&
github.event.sender.login != 'dependabot[bot]' &&
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
with:
files: "**/build/test-results/**/*.xml"
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Perform SonarQube Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
uses: eskatos/gradle-command-action@v1
with:
arguments: sonarqube
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
id: sonar
maven:
name: Maven
if: >
github.event.sender.login != 'dependabot[bot]' ||
( startsWith(github.head_ref, 'dependabot/maven') )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: mvn clean verify --file pom.xml