forked from jruby-gradle/jruby-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (172 loc) · 5.84 KB
/
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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Build
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Licensing
- name: Licensing
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain -S license
# Coding style
- name: Coding style
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain -i codenarcMain codenarcTest codenarcIntTest
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
# use a short path to avoid exceeding the path limit on Windows... sigh
with:
path: 'w'
- uses: actions/setup-java@v1
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Build
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all clean assemble
# Test
- name: UnitTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel test -i
# Test
- name: IntegrationTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel intTest -i
# Test
- name: CompatibilityTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel gradleTest
# Stop gradlew to avoid locking issues
- name: Cleanup
uses: eskatos/gradle-command-action@v1
with:
arguments: --stop
- name: Store reports
uses: actions/upload-artifact@v2
if: always()
with:
name: Test reports Windows
path: "**/build/reports/**"
retention-days: 5
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ 8, 11 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Build
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -S --console=plain --no-build-cache assemble validateTaskProperties
# Unit tests
- name: Unit tests
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache test
# Integration tests
- name: Integration tests
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache intTest
# Gradle tests
- name: Compatibility tests
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache gradleTest
- name: Store reports
uses: actions/upload-artifact@v2
if: always()
with:
name: Test reports
path: "**/build/reports/**"
retention-days: 5
publish:
runs-on: ubuntu-latest
# on:
# push:
# branches:
# - release
needs: build
if: ${{ github.repository == 'jruby-gradle/jruby-gradle-plugin' && github.ref == 'refs/heads/release' }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
- name: Publish to Gradle Portal
uses: eskatos/gradle-command-action@v1
with:
arguments: -i --console=plain --no-build-cache assemble publishPlugins -Dgradle.publish.key=${{ secrets.PUBLISH_KEY }} -Dgradle.publish.secret=${{ secrets.PUBLISH_SECRET }}
- name: Publish documentation
uses: eskatos/gradle-command-action@v1
with:
arguments: -i --console=plain --no-build-cache docs:publishGhPages -Dorg.ajoberstar.grgit.auth.username=${{ secrets.GH_PAGES_PUSH_USER }} -Dorg.ajoberstar.grgit.auth.password=${{ secrets.GH_PAGES_PUSH_TOKEN }} -Dorg.ajoberstar.grgit.auth.force=hardcoded