@@ -12,31 +12,24 @@ jobs:
12
12
name : Build SQLx CLI
13
13
runs-on : ubuntu-latest
14
14
steps :
15
- - uses : actions/checkout@v2
15
+ - uses : actions/checkout@v4
16
16
17
- - uses : actions-rs/toolchain@v1
18
- with :
19
- profile : minimal
20
- toolchain : stable
21
- override : true
17
+ - name : Use latest Rust
18
+ run : rustup override set stable
22
19
23
- - uses : Swatinem/rust-cache@v1
20
+ - uses : Swatinem/rust-cache@v2
24
21
with :
25
22
key : sqlx-cli
26
23
27
- - uses : actions-rs/cargo@v1
28
- with :
29
- command : build
30
- args : >
24
+ - run : >
25
+ cargo build
31
26
-p sqlx-cli
32
27
--bin sqlx
33
28
--release
34
29
--no-default-features
35
30
--features mysql,postgres,sqlite
36
- env :
37
- RUSTFLAGS : -D warnings
38
31
39
- - uses : actions/upload-artifact@v3
32
+ - uses : actions/upload-artifact@v4
40
33
with :
41
34
name : sqlx-cli
42
35
path : target/release/sqlx
56
49
57
50
steps :
58
51
- name : Get SQLx-CLI
59
- uses : actions/download-artifact@v3
52
+ uses : actions/download-artifact@v4
60
53
with :
61
54
name : sqlx-cli
62
55
# $HOME is interpreted differently by the shell
68
61
echo /home/runner/.local/bin >> $GITHUB_PATH
69
62
sleep 10
70
63
71
- - uses : actions/checkout@v2
72
-
73
- - uses : actions-rs/toolchain@v1
74
- with :
75
- profile : minimal
76
- toolchain : stable
77
- override : true
64
+ - uses : actions/checkout@v4
78
65
79
- - uses : Swatinem/rust-cache@v1
66
+ - uses : Swatinem/rust-cache@v2
80
67
with :
81
68
key : mysql-examples
82
69
87
74
run : sqlx db setup
88
75
89
76
- name : Todos (Run)
90
- uses : actions-rs/cargo@v1
91
77
env :
92
78
DATABASE_URL : mysql://root:password@localhost:3306/todos?ssl-mode=disabled
93
- with :
94
- # TODO: test full CLI
95
- command : run
96
- args : -p sqlx-example-mysql-todos
79
+ run : cargo run -p sqlx-example-mysql-todos
97
80
98
81
postgres :
99
82
name : PostgreSQL Examples
110
93
111
94
steps :
112
95
- name : Get SQLx-CLI
113
- uses : actions/download-artifact@v3
96
+ uses : actions/download-artifact@v4
114
97
with :
115
98
name : sqlx-cli
116
99
path : /home/runner/.local/bin
@@ -121,15 +104,9 @@ jobs:
121
104
echo $HOME/.local/bin >> $GITHUB_PATH
122
105
sleep 10
123
106
124
- - uses : actions/checkout@v2
125
-
126
- - uses : actions-rs/toolchain@v1
127
- with :
128
- profile : minimal
129
- toolchain : stable
130
- override : true
107
+ - uses : actions/checkout@v4
131
108
132
- - uses : Swatinem/rust-cache@v1
109
+ - uses : Swatinem/rust-cache@v2
133
110
with :
134
111
key : pg-examples
135
112
@@ -140,28 +117,19 @@ jobs:
140
117
run : sqlx db setup
141
118
142
119
- name : Axum Social with Tests (Check)
143
- uses : actions-rs/cargo@v1
144
120
env :
145
121
DATABASE_URL : postgres://postgres:password@localhost:5432/axum-social
146
- with :
147
- command : check
148
- args : -p sqlx-example-postgres-axum-social
122
+ run : cargo check -p sqlx-example-postgres-axum-social
149
123
150
124
- name : Axum Social with Tests (Test)
151
- uses : actions-rs/cargo@v1
152
125
env :
153
126
DATABASE_URL : postgres://postgres:password@localhost:5432/axum-social
154
- with :
155
- command : test
156
- args : -p sqlx-example-postgres-axum-social
127
+ run : cargo test -p sqlx-example-postgres-axum-social
157
128
158
129
# The Chat example has an interactive TUI which is not trivial to test automatically,
159
130
# so we only check that it compiles.
160
131
- name : Chat (Check)
161
- uses : actions-rs/cargo@v1
162
- with :
163
- command : check
164
- args : -p sqlx-example-postgres-chat
132
+ run : cargo check -p sqlx-example-postgres-chat
165
133
166
134
- name : Files (Setup)
167
135
working-directory : examples/postgres/files
@@ -170,12 +138,9 @@ jobs:
170
138
run : sqlx db setup
171
139
172
140
- name : Files (Run)
173
- uses : actions-rs/cargo@v1
174
141
env :
175
142
DATABASE_URL : postgres://postgres:password@localhost:5432/files
176
- with :
177
- command : run
178
- args : -p sqlx-example-postgres-files
143
+ run : cargo run -p sqlx-example-postgres-files
179
144
180
145
- name : JSON (Setup)
181
146
working-directory : examples/postgres/json
@@ -184,12 +149,9 @@ jobs:
184
149
run : sqlx db setup
185
150
186
151
- name : JSON (Run)
187
- uses : actions-rs/cargo@v1
188
152
env :
189
153
DATABASE_URL : postgres://postgres:password@localhost:5432/json
190
- with :
191
- command : run
192
- args : -p sqlx-example-postgres-json
154
+ run : cargo run -p sqlx-example-postgres-json
193
155
194
156
- name : Listen (Setup)
195
157
working-directory : examples/postgres/listen
@@ -198,12 +160,9 @@ jobs:
198
160
run : sqlx db create
199
161
200
162
- name : Listen (Run)
201
- uses : actions-rs/cargo@v1
202
163
env :
203
164
DATABASE_URL : postgres://postgres:password@localhost:5432/listen
204
- with :
205
- command : run
206
- args : -p sqlx-example-postgres-listen
165
+ run : cargo run -p sqlx-example-postgres-listen
207
166
208
167
- name : Mockable TODOs (Setup)
209
168
working-directory : examples/postgres/mockable-todos
@@ -212,13 +171,9 @@ jobs:
212
171
run : sqlx db setup
213
172
214
173
- name : Mockable TODOs (Run)
215
- uses : actions-rs/cargo@v1
216
174
env :
217
175
DATABASE_URL : postgres://postgres:password@localhost:5432/mockable-todos
218
- with :
219
- # TODO: test full CLI
220
- command : run
221
- args : -p sqlx-example-postgres-mockable-todos
176
+ run : cargo run -p sqlx-example-postgres-mockable-todos
222
177
223
178
- name : TODOs (Setup)
224
179
working-directory : examples/postgres/todos
@@ -227,13 +182,10 @@ jobs:
227
182
run : sqlx db setup
228
183
229
184
- name : TODOs (Run)
230
- uses : actions-rs/cargo@v1
231
185
env :
232
186
DATABASE_URL : postgres://postgres:password@localhost:5432/todos
233
- with :
234
- # TODO: test full CLI
235
- command : run
236
- args : -p sqlx-example-postgres-todos
187
+ # TODO: test full CLI
188
+ run : cargo run -p sqlx-example-postgres-todos
237
189
238
190
- name : Transaction (Setup)
239
191
working-directory : examples/postgres/transaction
@@ -242,12 +194,9 @@ jobs:
242
194
run : sqlx db setup
243
195
244
196
- name : Transaction (Run)
245
- uses : actions-rs/cargo@v1
246
197
env :
247
198
DATABASE_URL : postgres://postgres:password@localhost:5432/txn
248
- with :
249
- command : run
250
- args : -p sqlx-example-postgres-transaction
199
+ run : cargo run -p sqlx-example-postgres-transaction
251
200
252
201
sqlite :
253
202
name : SQLite Examples
@@ -256,7 +205,7 @@ jobs:
256
205
257
206
steps :
258
207
- name : Get SQLx-CLI
259
- uses : actions/download-artifact@v3
208
+ uses : actions/download-artifact@v4
260
209
with :
261
210
name : sqlx-cli
262
211
path : /home/runner/.local/bin
@@ -266,15 +215,9 @@ jobs:
266
215
chmod +x /home/runner/.local/bin/sqlx
267
216
echo /home/runner/.local/bin >> $GITHUB_PATH
268
217
269
- - uses : actions/checkout@v2
218
+ - uses : actions/checkout@v4
270
219
271
- - uses : actions-rs/toolchain@v1
272
- with :
273
- profile : minimal
274
- toolchain : stable
275
- override : true
276
-
277
- - uses : Swatinem/rust-cache@v1
220
+ - uses : Swatinem/rust-cache@v2
278
221
with :
279
222
key : sqlite-examples
280
223
@@ -284,9 +227,6 @@ jobs:
284
227
run : sqlx db setup --source=examples/sqlite/todos/migrations
285
228
286
229
- name : TODOs (Run)
287
- uses : actions-rs/cargo@v1
288
230
env :
289
231
DATABASE_URL : sqlite://todos.sqlite
290
- with :
291
- command : run
292
- args : -p sqlx-example-sqlite-todos
232
+ run : cargo run -p sqlx-example-sqlite-todos
0 commit comments