forked from pinterest/ktlint
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.72 KB
/
gradle-pr-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
name: PR Build
on:
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [ 8, 11 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Restore Gradle caches
uses: actions/cache@v1
with:
path: |
~/.gradle/caches/modules-2
~/.gradle/caches/files-2.1
~/.gradle/caches/metadata-2.96
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-cache-
- name: Restore Gradle wrapper
uses: actions/cache@v1
with:
path: |
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with release Kotlin version
run: ./gradlew clean build ktlint
- name: Upload dependency verification report
uses: actions/upload-artifact@v2
if: failure()
with:
name: Build artifacts
path: '**/build/**/dependency-verification-report.html'
if-no-files-found: warn
- name: Upload test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Test artifacts
path: '**/tests/**/*.html'
if-no-files-found: warn
- name: Build with dev Kotlin version
run: ./gradlew -PkotlinDev clean build ktlint