-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.89 KB
/
gradle-linux-pr.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
name: Java CI with Gradle in Linux On Pull Request
on:
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
- name: Cache Gradle and SonarQube Packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.sonar/cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/*.yml') }}
restore-keys: |
$(( runner.os ))-gradle-
- name: Grant Execute Permission for Gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: xvfb-run ./gradlew build -i
- name: Archive Unit Tests Report
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: unit-tests-report
path: '**/build/reports/tests/test'
- name: Archive Integration Tests Report
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: integration-tests-report
path: '**/build/reports/tests/integrationTest'
- name: Archive End to End Tests Report
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: integration-tests-report
path: '**/build/reports/tests/endToEndTest'
- name: Archive Jar and Fatjar
uses: actions/upload-artifact@v2
if: ${{ success() }}
with:
name: guesthouse-reservations-packages
path: '**/build/libs'