-
Notifications
You must be signed in to change notification settings - Fork 604
177 lines (158 loc) · 5.78 KB
/
ibis-backends-cloud.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
name: Cloud Backends
on:
push:
# Skip the backend suite if all changes are in the docs directory
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.qmd"
- "codecov.yml"
- ".envrc"
branches:
- main
pull_request_target:
types:
- labeled
permissions:
# this allows extractions/setup-just to list releases for `just` at a higher
# rate limit while restricting GITHUB_TOKEN permissions elsewhere
contents: read
env:
FORCE_COLOR: "1"
SQLALCHEMY_WARN_20: "1"
HYPOTHESIS_PROFILE: "ci"
jobs:
test_backends:
name: ${{ matrix.backend.title }} python-${{ matrix.python-version }}
# only a single bigquery or snowflake run at a time, otherwise test data is
# clobbered by concurrent runs
concurrency:
group: ${{ matrix.backend.title }}-${{ matrix.python-version }}-${{ github.event.label.name || 'ci-run-cloud' }}
cancel-in-progress: false
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.label.name == 'ci-run-cloud'
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.13"
backend:
- name: snowflake
title: Snowflake
extras:
- --extra snowflake
- name: databricks
title: Databricks
extras:
- --extra databricks
include:
- python-version: "3.10"
backend:
name: bigquery
title: BigQuery
extras:
- --extra bigquery
- python-version: "3.13"
backend:
name: bigquery
title: BigQuery
extras:
- --extra bigquery
- --extra geospatial
- python-version: "3.10"
backend:
name: snowflake
title: Snowflake + Snowpark
key: snowpark
extras:
- --extra snowflake
- python-version: "3.11"
backend:
name: snowflake
title: Snowflake + Snowpark
key: snowpark
extras:
- --extra snowflake
steps:
- name: checkout
uses: actions/checkout@v4
if: github.event.label.name != 'ci-run-cloud'
- name: checkout
if: github.event.label.name == 'ci-run-cloud'
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/create-github-app-token@v1.11.1
id: generate_token
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
- name: reset cloud ci run label
uses: actions-ecosystem/action-remove-labels@v1
if: github.event.label.name == 'ci-run-cloud'
with:
labels: ci-run-cloud
github_token: ${{ steps.generate_token.outputs.token }}
- name: install python
uses: actions/setup-python@v5
id: install_python
with:
python-version: ${{ matrix.python-version }}
- name: install uv
uses: astral-sh/setup-uv@v5.0.1
- name: install additional deps
if: matrix.backend.key == 'snowpark'
run: uv add --no-sync --optional snowflake snowflake-snowpark-python
- uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: download backend data
run: just download-data
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: setup databricks credentials
if: matrix.backend.name == 'databricks'
run: |
{
echo "DATABRICKS_HTTP_PATH=${DATABRICKS_HTTP_PATH}"
echo "DATABRICKS_SERVER_HOSTNAME=${DATABRICKS_SERVER_HOSTNAME}"
echo "DATABRICKS_TOKEN=${DATABRICKS_TOKEN}"
} >> "$GITHUB_ENV"
env:
DATABRICKS_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }}
DATABRICKS_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_SERVER_HOSTNAME }}
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
- name: setup snowflake credentials
if: matrix.backend.name == 'snowflake'
run: |
pyversion="${{ matrix.python-version }}"
{
echo "SNOWFLAKE_USER=${SNOWFLAKE_USER}"
echo "SNOWFLAKE_PASSWORD=${SNOWFLAKE_PASSWORD}"
echo "SNOWFLAKE_ACCOUNT=${SNOWFLAKE_ACCOUNT}"
echo "SNOWFLAKE_DATABASE=${SNOWFLAKE_DATABASE}"
echo "SNOWFLAKE_SCHEMA=${SNOWFLAKE_SCHEMA}_python${pyversion//./}_${{ matrix.backend.key }}"
echo "SNOWFLAKE_WAREHOUSE=${SNOWFLAKE_WAREHOUSE}"
} >> "$GITHUB_ENV"
env:
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
SNOWFLAKE_SCHEMA: ${{ secrets.SNOWFLAKE_SCHEMA }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
- name: enable snowpark testing
if: matrix.backend.key == 'snowpark'
run: echo "SNOWFLAKE_SNOWPARK=1" >> "$GITHUB_ENV"
- name: "run parallel tests: ${{ matrix.backend.name }}"
run: just ci-check "${{ join(matrix.backend.extras, ' ') }} --extra examples" -m ${{ matrix.backend.name }} --numprocesses auto --dist=loadgroup
- name: upload code coverage
if: success()
continue-on-error: true
uses: codecov/codecov-action@v5
with:
flags: backend,${{ matrix.backend.name }},${{ runner.os }},python-${{ steps.install_python.outputs.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}