-
Notifications
You must be signed in to change notification settings - Fork 10
197 lines (187 loc) · 7.06 KB
/
whirl-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
195
196
197
name: execute whirl ci for examples
on:
push:
branches:
- master
pull_request:
jobs:
shellcheck: # Job that list subdirectories of ./examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run shellcheck
uses: sudo-bot/action-shellcheck@latest
with:
# https://github.com/koalaman/shellcheck#how-to-use
cli-args: "-x whirl"
directories: # Job that list subdirectories of ./examples
runs-on: ubuntu-latest
outputs:
# generate output name dir by using inner step output
dir: ${{ steps.setdirs.outputs.dir }}
steps:
- uses: actions/checkout@v2
- id: setdirs # Give it an id to handle to get step outputs in the outputs key above
# run: echo "::set-output name=dir::$(ls -d ./examples/* | jq -R -s -c 'split("\n")[:-1]')"
run: echo "dir=$(ls -d ./examples/* | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
# Define step output named dir based on ls command transformed to JSON thanks to jq
examples: # Job that list subdirectories of ./examples
runs-on: ubuntu-latest
outputs:
# generate output name example by using inner step output
example: ${{ steps.setexamples.outputs.example }}
steps:
- uses: actions/checkout@v2
- id: setexamples # Give it an id to handle to get step outputs in the outputs key above
run: echo "example=$(ls -d ./examples/* | sed -r 's/\.\/examples\/(.*)/\1/g' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
# Define step output named example based on ls command transformed to JSON thanks to jq
whirl-ci-default-envs:
needs: [directories]
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
example_dir: ${{ fromJson(needs.directories.outputs.dir) }}
python_version: ["3.9", "3.12"]
airflow_version: ["2.2.5", "2.9.1"]
exclude:
- airflow_version: "2.2.5"
python_version: "3.12"
# Needs more memory than available on the runner
- example_dir: ./examples/dbt-spark-example
- example_dir: ./examples/spark-delta-sharing
- example_dir: ./examples/spark-s3-to-hive
# No default dag available for CI
- example_dir: ./examples/airflow-datasets
# Run without parallelism separately
- example_dir: ./examples/dbt-example
# Requires artifact downloaded from github.com/godatadriven/spot, which doesn't publish artifacts yet (2024-12-11)
- example_dir: ./examples/spark-opentelemetry
env:
PYTHON_VERSION: ${{ matrix.python_version }}
AIRFLOW_VERSION: ${{ matrix.airflow_version }}
steps:
- uses: actions/checkout@v2
- name: Run whirl CI ${{ matrix.example_dir }}
working-directory: ${{ matrix.example_dir }}
run: |
echo Run Ci from example directory ${{ matrix.example_dir }}
../../whirl ci
whirl-ci-default-envs-from-root-dir:
needs: [examples]
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
example: ${{ fromJson(needs.examples.outputs.example) }}
python_version: ["3.9", "3.12"]
airflow_version: ["2.2.5", "2.9.1"]
exclude:
- airflow_version: "2.2.5"
python_version: "3.12"
# Needs more memory than available on the runner
- example: dbt-spark-example
- example: spark-delta-sharing
- example: spark-s3-to-hive
# No default dag available for CI
- example: airflow-datasets
# Run without parallelism separately
- example: dbt-example
# Requires artifact downloaded from github.com/godatadriven/spot, which doesn't publish artifacts yet (2024-12-11)
- example: spark-opentelemetry
env:
PYTHON_VERSION: ${{ matrix.python_version }}
AIRFLOW_VERSION: ${{ matrix.airflow_version }}
steps:
- uses: actions/checkout@v2
- name: Run whirl CI example ${{ matrix.example }}
run: |
echo Run Ci for example ${{ matrix.example }}
./whirl -x ${{ matrix.example }} ci
whirl-ci-dbt-example:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
python_version: ["3.9", "3.12"]
airflow_version: ["2.2.5", "2.9.1"]
exclude:
- airflow_version: "2.2.5"
python_version: "3.12"
env:
PYTHON_VERSION: ${{ matrix.python_version }}
AIRFLOW_VERSION: ${{ matrix.airflow_version }}
steps:
- uses: actions/checkout@v2
- name: Run whirl CI dbt example
working-directory: ./examples/dbt-example
run: |
echo Run Ci from dbt-example directory
../../whirl ci
whirl-ci-opentelemetry-example:
if: false # Disabled until github.com/godatadriven/spot has public Releases (need a stable download URL)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run whirl CI opentelemetry example
working-directory: ./examples/spark-opentelemetry/
run: |
curl -fLSs \
-o ./whirl.setup.d/spot-complete.jar \
--url "https://github.com/godatadriven/spot/releases/..." # TODO spot-complete-3.5_2.21.jar
echo Run Ci from spark-opentelemetry directory
../../whirl ci
whirl-ci-extra-env-spark-s3-to-postgres:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run whirl CI non-default env
working-directory: ./examples/spark-s3-to-postgres/
run: |
echo Run Ci for example spark-s3-to-postgres with non-default env
../../whirl ci -e postgres-s3-spark
whirl-ci-extra-env-api-to-s3:
strategy:
fail-fast: false
max-parallel: 4
matrix:
python_version: ["3.9", "3.12"]
airflow_version: ["2.2.5", "2.9.1"]
exclude:
- airflow_version: "2.2.5"
python_version: "3.12"
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.python_version }}
AIRFLOW_VERSION: ${{ matrix.airflow_version }}
steps:
- uses: actions/checkout@v2
- name: Run whirl CI api-to-s3 on k8s executor
working-directory: ./examples/api-to-s3/
run: |
echo Run Ci for example api-to-s3 with k8s executor env
../../whirl ci -e api-python-s3-k8s
whirl-ci-extra-env-ha-scheduler:
strategy:
fail-fast: false
max-parallel: 4
matrix:
python_version: ["3.9", "3.12"]
airflow_version: ["2.2.5", "2.9.1"]
exclude:
- airflow_version: "2.2.5"
python_version: "3.12"
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.python_version }}
AIRFLOW_VERSION: ${{ matrix.airflow_version }}
steps:
- uses: actions/checkout@v2
- name: Run whirl CI ha-scheduler env
working-directory: ./examples/external-airflow-db/
run: |
echo Run Ci for example external-airflow-db with ha-scheduler env
../../whirl ci -e ha-scheduler