Skip to content

Commit

Permalink
remove duplication by adding more commands to the Justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jan 31, 2024
1 parent c43f3a4 commit 4ed6b49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
rustup override set stable
rustup update stable
- name: install `just`
run: sudo snap install --edge --classic just

- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -53,12 +56,7 @@ jobs:
run: cargo install sqlx-cli --no-default-features --features postgres

- name: run sqlx prepare --check
run: |
cargo sqlx prepare \
--database-url $DOCSRS_DATABASE_URL \
--workspace \
--check \
-- --all-targets --all-features
run: just sqlx-check

- name: test reverse migrations
run: |
Expand Down Expand Up @@ -229,7 +227,10 @@ jobs:
rustup update stable
rustup component add clippy
- name: install `just`
run: sudo snap install --edge --classic just

- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2

- run: cargo clippy --all-features --all-targets --workspace --locked -- -D warnings
- run: just lint
11 changes: 9 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
_default:
just --list

sqlx-prepare:
sqlx-prepare ADDITIONAL_ARGS="":
cargo sqlx prepare \
--database-url $DOCSRS_DATABASE_URL \
--workspace \
--workspace {{ ADDITIONAL_ARGS }} \
-- --all-targets --all-features

sqlx-check:
just sqlx-prepare "--check"

lint:
cargo clippy --all-features --all-targets --workspace --locked -- -D warnings

0 comments on commit 4ed6b49

Please sign in to comment.