forked from precog/fs2-job
-
Notifications
You must be signed in to change notification settings - Fork 0
239 lines (201 loc) · 8.86 KB
/
Copy pathci.yml
File metadata and controls
239 lines (201 loc) · 8.86 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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# This file was automatically generated by sbt-github-actions using the
# githubWorkflowGenerate task. You should add and commit this file to
# your git repository. It goes without saying that you shouldn't edit
# this file by hand! Instead, if you wish to make changes, you should
# change your sbt build configuration to revise the workflow description
# to meet your needs, then regenerate this file.
name: Continuous Integration
on:
pull_request:
branches: [master, backport/v*]
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [master, backport/v*]
env:
SBT: ./sbt
JABBA_INDEX: 'https://github.com/1Jo1/jabba/raw/support-graalvm-java-8-and-11/index.json'
REPO_SLUG: ${{ github.repository }}
ENCRYPTION_PASSWORD: ${{ secrets.ENCRYPTION_PASSWORD }}
GITHUB_ACTOR: precog-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Build and Test
if: '!(github.event_name == ''pull_request'' && github.event.pull_request.draft)'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.10, 2.13.1]
java: [adopt@1.8, graalvm8@20.1.0]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v2
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v5
with:
java-version: ${{ matrix.java }}
- name: Cache ivy2
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (generic)
uses: actions/cache@v1
with:
path: ~/.coursier/cache/v1
key: ${{ runner.os }}-generic-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (linux)
if: contains(runner.os, 'linux')
uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (macOS)
if: contains(runner.os, 'macos')
uses: actions/cache@v1
with:
path: ~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (windows)
if: contains(runner.os, 'windows')
uses: actions/cache@v1
with:
path: ~/AppData/Local/Coursier/Cache/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Common sbt setup
if: env.ENCRYPTION_PASSWORD != null
run: $SBT ++${{ matrix.scala }} transferCommonResources exportSecretsForActions
- name: Check that workflows are up to date
run: $SBT ++${{ matrix.scala }} githubWorkflowCheck
- run: $SBT ++${{ matrix.scala }} ci
- name: Upload target directory 'target' (${{ matrix.scala }})
uses: actions/upload-artifact@v1
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}-target
path: target
- name: Upload target directory 'core/target' (${{ matrix.scala }})
uses: actions/upload-artifact@v1
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}-core_target
path: core/target
- name: Upload target directory 'project/target'
uses: actions/upload-artifact@v1
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-project_target
path: project/target
publish:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/backport/v'))
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.10]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v2
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v5
with:
java-version: ${{ matrix.java }}
- name: Cache ivy2
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (generic)
uses: actions/cache@v1
with:
path: ~/.coursier/cache/v1
key: ${{ runner.os }}-generic-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (linux)
if: contains(runner.os, 'linux')
uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (macOS)
if: contains(runner.os, 'macos')
uses: actions/cache@v1
with:
path: ~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache coursier (windows)
if: contains(runner.os, 'windows')
uses: actions/cache@v1
with:
path: ~/AppData/Local/Coursier/Cache/v1
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Cache sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('.versions.json') }}
- name: Download target directory 'target' (2.12.10)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-target
path: target
- name: Download target directory 'target' (2.13.1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.13.1-${{ matrix.java }}-target
path: target
- name: Download target directory 'core/target' (2.12.10)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.12.10-${{ matrix.java }}-core_target
path: core/target
- name: Download target directory 'core/target' (2.13.1)
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-2.13.1-${{ matrix.java }}-core_target
path: core/target
- name: Download target directory 'project/target'
uses: actions/download-artifact@v1
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-project_target
path: project/target
- name: Common sbt setup
run: $SBT ++${{ matrix.scala }} transferCommonResources transferPublishAndTagResources exportSecretsForActions
- run: ./scripts/commonSetup
- name: Publish artifacts and create tag
run: ./scripts/publishAndTag ${{ github.repository }}
auto-merge:
name: Auto Merge
needs: [build]
if: 'github.event_name == ''pull_request'' && contains(github.head_ref, ''version-bump'') && contains(github.event.pull_request.labels.*.name, ''version: revision'')'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.10]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v2
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v5
with:
java-version: ${{ matrix.java }}
- name: Common sbt setup
run: $SBT ++${{ matrix.scala }} transferCommonResources exportSecretsForActions
- name: Fetch the latest sdmerge
run: |
curl -L https://github.com/precog/devtools/raw/master/bin/sdmerge > /tmp/sdmerge
chmod +x /tmp/sdmerge
- name: Self-merge
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
git config --global user.email "bot@precog.com"
git config --global user.name "Precog Bot"
/tmp/sdmerge $GITHUB_REPOSITORY $PR_NUMBER