-
Notifications
You must be signed in to change notification settings - Fork 45
194 lines (160 loc) · 4.52 KB
/
ci.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
name: Continuous Integration
on:
pull_request:
branches:
- '**'
push:
branches:
- '**'
tags:
- 'v*'
jobs:
build-scala:
runs-on: ubuntu-20.04
strategy:
matrix:
spark_version:
- "3.2.4"
- "3.3.2"
- "3.4.0"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Scala Build Tools
uses: ./.github/actions/init-scala-env
- name: Compile Scala Project
env:
SPARK_VERSION: ${{ matrix.spark_version }}
run: make compile-scala
- name: Test Scala Project
# python/* branches are not supposed to change scala code, trust them
if: ${{ !startsWith(github.event.inputs.from_branch, 'python/') }}
env:
SPARK_VERSION: ${{ matrix.spark_version }}
run:
ulimit -c unlimited
make test-scala
- name: Build Spark Assembly
env:
SPARK_VERSION: ${{ matrix.spark_version }}
shell: bash
run: make build-scala
- name: Cache Spark Assembly
uses: actions/cache@v3
with:
path: ./dist/*
key: dist-${{ matrix.spark_version }}-${{ github.sha }}
build-python:
# scala/* branches are not supposed to change python code, trust them
if: ${{ !startsWith(github.event.inputs.from_branch, 'scala/') }}
runs-on: ubuntu-20.04
needs: build-scala
strategy:
matrix:
python:
- "3.8"
- "3.9"
spark_version:
- "3.2.4"
- "3.3.2"
- "3.4.0"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/init-python-env
with:
python_version: ${{ matrix.python }}
spark_version: ${{ matrix.spark_version }}
- name: Static checks
shell: bash
run: make lint-python
- uses: actions/cache@v3
with:
path: ./dist/*
key: dist-${{ matrix.spark_version }}-${{ github.sha }}
- name: Run tests
env:
SPARK_VERSION: ${{ matrix.spark_version }}
shell: bash
run: make test-python-quick
publish-scala:
name: Publish Scala Artifacts
needs: [ build-scala, build-python ]
runs-on: ubuntu-20.04
if: (github.event_name != 'pull_request') && startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
spark_version:
- "3.2.4"
- "3.3.2"
- "3.4.0"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Scala Build Tools
uses: ./.github/actions/init-scala-env
- name: Publish JARs to GitHub Packages
shell: bash
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SPARK_VERSION: ${{ matrix.spark_version }}
run: make publish-scala
- name: Build Spark Assembly
env:
SPARK_VERSION: ${{ matrix.spark_version }}
shell: bash
run: make build-scala
- name: Cache Spark Assembly
uses: actions/cache@v3
with:
path: ./dist/*
key: dist-${{ matrix.spark_version }}-${{ github.ref }}
publish-python:
name: Publish Scala Artifacts
needs: [ publish-scala ]
runs-on: ubuntu-20.04
if: (github.event_name != 'pull_request') && startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
python:
- "3.8"
- "3.9"
spark_version:
- "3.2.4"
- "3.3.2"
- "3.4.0"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/init-python-env
with:
python_version: ${{ matrix.python }}
spark_version: ${{ matrix.spark_version }}
- uses: actions/cache@v3
with:
path: ./dist/*
key: dist-${{ matrix.spark_version }}-${{ github.ref }}
- name: Build Python whl
shell: bash
run: make build-python
# TODO: Where does this go, do we need it?
# - name: upload artefacts
# uses: ./.github/actions/upload_artefacts
# TODO: Where does this go, do we need it?
# - uses: actions/cache@v3
# with:
# path: ./dist/*
# key: dist-${{ github.sha }}
# TODO: Where does this go?
# - name: upload wheel
# working-directory: dist
# shell: bash
# run: