-
Notifications
You must be signed in to change notification settings - Fork 17
63 lines (60 loc) · 1.69 KB
/
maven.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
name: Java CI with Maven
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
build:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Shallow clones should be disabled for a better relevancy of SonarQube analysis
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: 17
distribution: temurin
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Install WebKit # required for SWT Browser
run: |
sudo apt update
sudo apt install -y libwebkit2gtk-4.0-37
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: |
~/.m2
~/.sonar/cache
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/*.yml', '**/*.target') }}
restore-keys: ${{ runner.os }}-m2-
- name: Set Maven Additional Goals
run: |
echo "SONARGOAL=sonar:sonar" >> $GITHUB_ENV
if: ${{ env.SONAR_TOKEN }}
- name: Maven Build
run: >
xvfb-run mvn verify -Pjacoco $SONARGOAL
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: ${{ failure() || cancelled() }}
with:
name: test-results-${{ runner.os }}
path: '**/*.tests/target'
- name: Archive UI Tests Screenshots
uses: actions/upload-artifact@v2
if: ${{ failure() || cancelled() }}
with:
name: screenshots-${{ runner.os }}
path: '**/*.tests/screenshots'