This repository was archived by the owner on Nov 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.5 KB
/
pr.yml
File metadata and controls
51 lines (49 loc) · 1.5 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
name: Pull Request
on:
push:
branches: [ develop, master ]
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
branches: [ develop, master ]
jobs:
build_n_test:
name: Build & Test
if: github.event_name == 'push' || !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout project files
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache gradle wrapper and packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle
- name: Build
run: ./gradlew build
timeout-minutes: 5
- name: Test
run: ./gradlew test --continue
continue-on-error: true
timeout-minutes: 5
- name: Annotate PR with JUnit Report
uses: mikepenz/action-junit-report@v2.2.0
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload test and lint reports
uses: actions/upload-artifact@v2
with:
name: reports
path: "**/build/reports/*"