forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
243 lines (226 loc) · 7.67 KB
/
backend.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
242
243
name: Backend
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
backend_all: ${{ steps.changes.outputs.backend_all }}
steps:
- uses: actions/checkout@v3
- name: Test which files changed
uses: dorny/[email protected]
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
be-linter-cloverage:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cloverage'
- name: Build static viz frontend
run: yarn build-static-viz
- name: Collect the test coverage
run: clojure -X:dev:ee:ee-dev:test:cloverage
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: ./target/coverage/codecov.json
flags: back-end
be-linter-clj-kondo:
needs: files-changed
if: needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Run clj-kondo
run: >-
docker run
--volume $PWD:/work
--rm
cljkondo/clj-kondo:2023.02.17
clj-kondo
--config /work/.clj-kondo/config.edn
--config-dir /work/.clj-kondo
--parallel
--lint
/work/src
/work/test
/work/enterprise/backend/src
/work/enterprise/backend/test
/work/shared/src
/work/shared/test
/work/modules/drivers/athena/src
/work/modules/drivers/athena/test
/work/modules/drivers/bigquery-cloud-sdk/src
/work/modules/drivers/bigquery-cloud-sdk/test
/work/modules/drivers/druid/src
/work/modules/drivers/druid/test
/work/modules/drivers/googleanalytics/src
/work/modules/drivers/googleanalytics/test
/work/modules/drivers/mongo/src
/work/modules/drivers/mongo/test
/work/modules/drivers/oracle/src
/work/modules/drivers/oracle/test
/work/modules/drivers/presto-jdbc/src
/work/modules/drivers/presto-jdbc/test
/work/modules/drivers/redshift/src
/work/modules/drivers/redshift/test
/work/modules/drivers/snowflake/src
/work/modules/drivers/snowflake/test
/work/modules/drivers/sparksql/src
/work/modules/drivers/sparksql/test
/work/modules/drivers/sqlite/src
/work/modules/drivers/sqlite/test
/work/modules/drivers/sqlserver/src
/work/modules/drivers/sqlserver/test
/work/modules/drivers/vertica/src
/work/modules/drivers/vertica/test
be-linter-eastwood:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'eastwood'
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood
name: Run Eastwood linter
# Because it's not possible to conditionally run only `java-11-ee` test in the draft mode,
# we have to extract that job manually here. Backend developers have requested that this
# test runs at all times to give them an early warning sign is something is broken.
be-tests-java-11-ee-pre-check:
needs: files-changed
if: github.event.pull_request.draft == true && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
name: be-tests-java-11-ee-pre-check
timeout-minutes: 35
steps:
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: java-11-ee-pre-check
- run: yarn install --frozen-lockfile --prefer-offline
- name: Build static viz frontend
run: yarn build-static-viz
- name: Run tests
run: clojure -X:dev:ci:test:ee:ee-dev
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1
if: failure()
with:
path: 'target/junit/**/*_test.xml'
name: JUnit Test Report be-tests-java-11-ee-pre-check
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false
be-tests:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
edition: [oss, ee]
java-version: [11, 17]
steps:
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-tests
- run: yarn install --frozen-lockfile --prefer-offline
- name: Build static viz frontend
run: yarn build-static-viz
- name: Run tests
run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1
if: failure()
with:
path: 'target/junit/**/*_test.xml'
name: JUnit Test Report be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false
be-tests-stub:
needs: files-changed
if: |
always() &&
github.event.pull_request.draft == false &&
needs.files-changed.outputs.backend_all == 'false'
runs-on: ubuntu-22.04
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
edition: [oss, ee]
java-version: [11, 17]
steps:
- run: |
echo "Didn't run due to conditional filtering"
# checks that all the namespaces we actually ship can be compiled, without any dependencies that we don't ship (such
# as `:dev` dependencies). See #27009 for more context.
be-check:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-22.04
name: be-check-java-${{ matrix.java-version }}
timeout-minutes: 10
strategy:
matrix:
java-version: [11, 17, 19]
steps:
- uses: actions/checkout@v3
- name: Prepare backend
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-check
- name: Check namespaces
run: clojure -M:ee:drivers:check
be-check-stub:
needs: files-changed
if: |
always() &&
github.event.pull_request.draft == false &&
needs.files-changed.outputs.backend_all == 'false'
runs-on: ubuntu-22.04
name: be-check-java-${{ matrix.java-version }}
timeout-minutes: 10
strategy:
matrix:
java-version: [11, 17, 19]
steps:
- run: |
echo "Didn't run due to conditional filtering"