-
Notifications
You must be signed in to change notification settings - Fork 72
183 lines (151 loc) · 5.64 KB
/
pr.yaml
File metadata and controls
183 lines (151 loc) · 5.64 KB
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
---
name: pr
on:
pull_request:
branches:
- main
- spiceai
jobs:
lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting
run: cargo fmt --all -- --check
- run: cargo clippy --all-features -- -D warnings
build:
name: Build (${{ matrix.features }})
runs-on: ubuntu-latest
strategy:
matrix:
features:
- 'no-default-features'
- 'clickhouse'
- 'duckdb'
- 'postgres'
- 'sqlite'
- 'mysql'
- 'flight'
- 'adbc'
- 'mongodb'
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Build with ${{ matrix.features }}
run: |
if [ "${{ matrix.features }}" = "no-default-features" ]; then
cargo check --no-default-features
else
cargo check --no-default-features --features ${{ matrix.features }}
fi
integration-test:
name: Tests
runs-on: ubuntu-latest
env:
PG_DOCKER_IMAGE: ghcr.io/cloudnative-pg/postgresql:16-bookworm
MYSQL_DOCKER_IMAGE: mysql:8.0
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Cache Docker images
id: docker-cache
uses: actions/cache@v5
with:
path: /tmp/docker-images
key: docker-images-${{ env.PG_DOCKER_IMAGE }}-${{ env.MYSQL_DOCKER_IMAGE }}
- name: Load or pull Docker images
run: |
if [ -f /tmp/docker-images/postgres.tar ] && [ -f /tmp/docker-images/mysql.tar ]; then
echo "Loading cached Docker images..."
docker load -i /tmp/docker-images/postgres.tar
docker load -i /tmp/docker-images/mysql.tar
else
echo "Pulling Docker images..."
docker pull ${{ env.PG_DOCKER_IMAGE }}
docker pull ${{ env.MYSQL_DOCKER_IMAGE }}
mkdir -p /tmp/docker-images
docker save -o /tmp/docker-images/postgres.tar ${{ env.PG_DOCKER_IMAGE }}
docker save -o /tmp/docker-images/mysql.tar ${{ env.MYSQL_DOCKER_IMAGE }}
fi
- name: Free Disk Space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
echo "some directories deleted"
sudo apt-get update >/dev/null 2>&1
sudo apt install aptitude -y >/dev/null 2>&1 || true
sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
google-cloud-sdk imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete libmysqlclient \
yarn chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
-y -f >/dev/null 2>&1 || true
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 || true
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 || true
sudo apt-get autoremove -y >/dev/null 2>&1 || true
sudo apt-get autoclean -y >/dev/null 2>&1 || true
echo "some packages purged"
df -h
- name: Install ODBC & Sqlite
run: |
sudo apt-get install -y unixodbc-dev
sudo apt-get install -y libsqlite3-dev
- name: Install ADBC drivers
run: |
curl -LsSf https://dbc.columnar.tech/install.sh | sh
dbc install sqlite
dbc install duckdb
- name: Run tests
run: make test
python-integration-test:
name: Python Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
python
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: 'python/pyproject.toml'
- name: Install ODBC, Sqlite and Roapi
run: |
sudo apt-get install -y unixodbc-dev libsqliteodbc
sudo apt-get install -y libsqlite3-dev
RUSTUP_TOOLCHAIN=stable cargo install --git https://github.com/roapi/roapi --branch main --bins roapi
- name: Build Python package and run tests
run: |
cd python
uv sync --dev --no-install-package datafusion
uv run --no-project maturin develop --uv --release
cd python/tests
uv run --no-project pytest -v .