-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (127 loc) · 3.65 KB
/
quick-check.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: quick-check
on:
push:
branches:
- '*'
env:
jdk-version: openjdk@~1.15.0
project-name: Kt NPM Publish
workflow: quick-check
gradle-options: "--no-daemon --console=plain --stacktrace"
jobs:
setup:
runs-on: ubuntu-latest
steps:
# - &cache_jdk
- name: Cache JDK
uses: actions/cache@v2
with:
path: ~/.jabba
key: ${{ runner.os }}-jdk-${{ env.jdk-version }}
restore-keys: |
${{ runner.os }}-jdk-
# - &install_jdk
- uses: battila7/jdk-via-jabba@v1
name: Restore JDK
with:
jdk: ${{ env.jdk-version }}
build:
runs-on: ubuntu-latest
needs:
- setup
steps:
# - &checkout_code
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # all history
- name: Get All Tags
run: git fetch --tags -f
# - *cache_jdk
- name: Cache JDK
uses: actions/cache@v2
with:
path: ~/.jabba
key: ${{ runner.os }}-jdk-${{ env.jdk-version }}
restore-keys: |
${{ runner.os }}-jdk-
# - *install_jdk
- uses: battila7/jdk-via-jabba@v1
name: Restore JDK
with:
jdk: ${{ env.jdk-version }}
# - &cache_gradle
- name: Cache Gradle Data
uses: actions/cache@v2
with:
path: |
~/.m2/repository
~/.gradle/caches
~/gradle/wrapper
**/build
**/.gradle
key: ${{ runner.os }}-${{ env.workflow }}-gradle-${{ github.sha }}-build
restore-keys: |
${{ runner.os }}-${{ env.workflow }}-gradle-${{ github.sha }}-build
- name: Show Env
run: ./gradlew --version
- name: Setup Gradle
run: ./gradlew ${{ env.gradle-options }}
- name: Check Code Style
run: ./gradlew ${{ env.gradle-options }} ktlintCheck
- name: Archive KtLint Reports
uses: actions/upload-artifact@v2
if: failure()
with:
name: ktlint-reports
path: '**/build/reports/ktlint'
- name: Check for Bugs
run: ./gradlew ${{ env.gradle-options }} detekt
- name: Compile
run: ./gradlew ${{ env.gradle-options }} assemble --parallel
test:
runs-on: ubuntu-latest
needs:
- build
steps:
# - *checkout_code
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # all history
- name: Get All Tags
run: git fetch --tags -f
# - *cache_jdk
- name: Cache JDK
uses: actions/cache@v2
with:
path: ~/.jabba
key: ${{ runner.os }}-jdk-${{ env.jdk-version }}
restore-keys: |
${{ runner.os }}-jdk-
# - *install_jdk
- uses: battila7/jdk-via-jabba@v1
name: Restore JDK
with:
jdk: ${{ env.jdk-version }}
# - *cache_gradle
- name: Cache Gradle Data
uses: actions/cache@v2
with:
path: |
~/.m2/repository
~/.gradle/caches
~/gradle/wrapper
**/build
**/.gradle
key: ${{ runner.os }}-${{ env.workflow }}-gradle-${{ github.sha }}-test
restore-keys: |
${{ runner.os }}-${{ env.workflow }}-gradle-${{ github.sha }}-build
- name: Test
run: ./gradlew ${{ env.gradle-options }} test
- name: Archive Test Reports
uses: actions/upload-artifact@v2
if: failure() || success()
with:
name: jvm-test-reports
path: '**/build/reports/tests/test'