-
-
Notifications
You must be signed in to change notification settings - Fork 195
249 lines (234 loc) · 11.3 KB
/
rust.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
244
245
246
247
248
249
name: tests
on:
pull_request:
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
- .gitignore
push:
branches:
- master
- 0.*.x
- pr/**/ci
paths-ignore:
- '**.md'
- '.github/ISSUE_TEMPLATE/**'
- .gitignore
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo fmt --manifest-path sea-query-binder/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-rusqlite/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-postgres/Cargo.toml --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-binder/Cargo.toml --workspace --features runtime-async-std-rustls --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array -- -D warnings
- run: cargo clippy --manifest-path sea-query-rusqlite/Cargo.toml --all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-postgres/Cargo.toml --all-features --workspace -- -D warnings
build:
name: Build `sea-query`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --workspace --no-default-features
- run: cargo build --workspace --all-features
- run: cargo build --workspace --features=with-chrono
- run: cargo build --workspace --features=with-json
- run: cargo build --workspace --features=with-rust_decimal
- run: cargo build --workspace --features=with-bigdecimal
- run: cargo build --workspace --features=with-uuid
- run: cargo build --workspace --features=with-time
- run: cargo build --workspace --features=with-ipnetwork
- run: cargo build --workspace --features=with-mac_address
- run: cargo build --workspace --features=postgres-array
- run: cargo build --workspace --features=thread-safe
binder-build:
name: Build `sea-query-binder`
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runtime: [async-std]
tls: [rustls]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-chrono
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-json
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-rust_decimal
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-bigdecimal
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-uuid
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-time
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=with-mac_address
- run: cargo build --manifest-path sea-query-binder/Cargo.toml --workspace --features sqlx-postgres,sqlx-sqlite,sqlx-any,sqlx-mysql --features=runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features=postgres-array
rusqlite-build:
name: Build `sea-query-rusqlite`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-chrono
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-json
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-rust_decimal
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-bigdecimal
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-uuid
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-time
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=with-mac_address
- run: cargo build --manifest-path sea-query-rusqlite/Cargo.toml --workspace --features=postgres-array
postgres-build:
name: Build `sea-query-postgres`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-chrono
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-json
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-rust_decimal
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-bigdecimal
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-uuid
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-time
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-ipnetwork
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=with-mac_address
- run: cargo build --manifest-path sea-query-postgres/Cargo.toml --workspace --features=postgres-array
test:
name: Unit Test
runs-on: ubuntu-latest
needs: ["build"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
derive-test:
name: Derive Tests
runs-on: ubuntu-latest
needs: ["build"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --package sea-query-derive
- run: cargo test --package sea-query-derive
sqlite:
name: SQLite
runs-on: ubuntu-latest
needs: ["test", "derive-test", "rusqlite-build", "binder-build"]
strategy:
matrix:
example: [rusqlite, sqlx_sqlite]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
mysql:
name: MySQL
runs-on: ubuntu-latest
needs: ["test", "derive-test", "binder-build"]
strategy:
matrix:
version: [8.0, 5.7]
example: [sqlx_mysql]
services:
mysql:
image: mysql:${{ matrix.version }}
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DATABASE: query
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ROOT_PASSWORD: sea
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
mariadb:
name: MariaDB
runs-on: ubuntu-latest
needs: ["test", "derive-test", "binder-build"]
strategy:
matrix:
version: [10.6]
example: [sqlx_mysql]
services:
mariadb:
image: mariadb:${{ matrix.version }}
env:
MYSQL_HOST: 127.0.0.1
MYSQL_DATABASE: query
MYSQL_USER: sea
MYSQL_PASSWORD: sea
MYSQL_ROOT_PASSWORD: sea
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml
postgres:
name: PostgreSQL
runs-on: ubuntu-latest
needs: ["test", "derive-test", "binder-build", "postgres-build"]
strategy:
matrix:
version: [14.4, 13.7, 12.11]
example: [postgres, sqlx_postgres]
services:
postgres:
image: postgres:${{ matrix.version }}
env:
POSTGRES_HOST: 127.0.0.1
POSTGRES_DB: query
POSTGRES_USER: sea
POSTGRES_PASSWORD: sea
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --manifest-path examples/${{ matrix.example }}/Cargo.toml
- run: cargo run --manifest-path examples/${{ matrix.example }}/Cargo.toml