Skip to content

Commit 4ed6b49

Browse files
committed
remove duplication by adding more commands to the Justfile
1 parent c43f3a4 commit 4ed6b49

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.github/workflows/ci.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
rustup override set stable
2929
rustup update stable
3030
31+
- name: install `just`
32+
run: sudo snap install --edge --classic just
33+
3134
- name: restore build & cargo cache
3235
uses: Swatinem/rust-cache@v2
3336
with:
@@ -53,12 +56,7 @@ jobs:
5356
run: cargo install sqlx-cli --no-default-features --features postgres
5457

5558
- name: run sqlx prepare --check
56-
run: |
57-
cargo sqlx prepare \
58-
--database-url $DOCSRS_DATABASE_URL \
59-
--workspace \
60-
--check \
61-
-- --all-targets --all-features
59+
run: just sqlx-check
6260

6361
- name: test reverse migrations
6462
run: |
@@ -229,7 +227,10 @@ jobs:
229227
rustup update stable
230228
rustup component add clippy
231229
230+
- name: install `just`
231+
run: sudo snap install --edge --classic just
232+
232233
- name: restore build & cargo cache
233234
uses: Swatinem/rust-cache@v2
234235

235-
- run: cargo clippy --all-features --all-targets --workspace --locked -- -D warnings
236+
- run: just lint

Justfile

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
_default:
33
just --list
44

5-
sqlx-prepare:
5+
sqlx-prepare ADDITIONAL_ARGS="":
66
cargo sqlx prepare \
77
--database-url $DOCSRS_DATABASE_URL \
8-
--workspace \
8+
--workspace {{ ADDITIONAL_ARGS }} \
99
-- --all-targets --all-features
10+
11+
sqlx-check:
12+
just sqlx-prepare "--check"
13+
14+
lint:
15+
cargo clippy --all-features --all-targets --workspace --locked -- -D warnings
16+

0 commit comments

Comments
 (0)