-
Notifications
You must be signed in to change notification settings - Fork 111
241 lines (204 loc) · 6.64 KB
/
tests.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
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
240
241
name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "**"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
conda-solver: libmamba
activate-environment: glow
- name: Cache Conda env
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/glow
key: conda-${{ hashFiles('python/environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: conda env update -n glow -f python/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Certs
run: sudo apt-get install -y ca-certificates
- name: Check docs links
run: (cd docs && make linkcheck)
continue-on-error: true
spark-tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
spark_version: [3.4.1, 3.5.1]
scala_version: [2.12.19]
env:
SPARK_VERSION: ${{ matrix.spark_version }}
SCALA_VERSION: ${{ matrix.scala_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "8"
cache: "sbt"
cache-dependency-path: |
build.sbt
plugins.sbt
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
conda-solver: libmamba
activate-environment: glow
- name: Cache Conda env
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/glow
key: conda-${{ hashFiles('python/environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: conda env update -n glow -f python/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install correct PySpark version
run: pip install pyspark==${{ matrix.spark_version }}
- name: Scala tests
run: sbt compile coverage core/test core/coverageReport exit
- name: Python tests
run: sbt python/test exit
- name: Docs tests
run: sbt docs/test exit
- name: Build artifacts
run: bin/build --scala --python
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: binaries-${{ github.job }}-${{ matrix.spark_version}}-${{ matrix.scala_version }}
path: |
core/target/**/glow*assembly*.jar
python/dist/*.whl
- name: Upload results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ github.job }}-${{ matrix.spark_version }}-${{ matrix.scala_version}}
path: |
core/target/**/test-reports
unit-tests.log
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml, *scoverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
verbose: true
# Dummy job so that required statuses don't need to change with Spark / scala matrix
spark-tests-success:
runs-on: ubuntu-latest
needs: spark-tests
steps:
- run: echo "Spark tests passed!"
spark-4-tests:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.title, '[SPARK4]')
defaults:
run:
shell: bash -el {0}
env:
SPARK_VERSION: 4.0.0-SNAPSHOT
SCALA_VERSION: 2.13.14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "17"
cache: "sbt"
cache-dependency-path: |
build.sbt
plugins.sbt
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
conda-solver: libmamba
activate-environment: glow-spark4
- name: Cache Conda env
uses: actions/cache@v3
with:
path: /usr/share/miniconda/envs/glow-spark4
key: conda-${{ hashFiles('python/spark-4-environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: conda env update -n glow-spark4 -f python/spark-4-environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Clone Spark (for PySpark source)
run: (cd $HOME && git clone https://github.com/apache/spark.git)
- name: Scala tests
run: sbt core/test exit
- name: Uninstall PySpark
run: pip uninstall -y pyspark
- name: Python tests
run: EXTRA_PYTHON_PATH=$HOME/spark/python sbt python/test exit
- name: Docs tests
run: EXTRA_PYTHON_PATH=$HOME/spark/python sbt docs/test exit
- name: Build artifacts
run: bin/build --scala --python
- name: Test assembly jar
run: java -cp core/target/**/glow*assembly*.jar io.projectglow.TestAssemblyJar
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: binaries-${{ github.job }}
path: |
core/target/**/glow*assembly*.jar
python/dist/*.whl
- name: Upload results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ github.job }}
path: |
core/target/**/test-reports
unit-tests.log
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml, *scoverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
verbose: true