Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/postgres/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ runs:
pg_isready
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'password'"

- name: Setup database
# `#[sqlx::test]` gives each test its own database and applies the
# migrations to it, so this only has to exist for sqlx to connect to and
# keep its bookkeeping in. No migrations are run here, and sqlx-cli is not
# needed.
- name: Create database
shell: bash
run: cargo sqlx database setup
run: sudo -u postgres createdb sqlxmq
8 changes: 3 additions & 5 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check
- run: cargo check --workspace --all-targets

fmt:
name: Rustfmt
Expand All @@ -20,7 +20,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt -- --check
- run: cargo fmt --all -- --check

clippy:
name: Clippy
Expand All @@ -31,7 +31,7 @@ jobs:
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings
- run: cargo clippy --workspace --all-targets -- -D warnings

test:
name: Test
Expand All @@ -42,7 +42,6 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo install sqlx-cli --locked
- uses: ./.github/actions/postgres
- run: cargo test -- --nocapture

Expand All @@ -55,7 +54,6 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo install sqlx-cli --locked
- uses: ./.github/actions/postgres
- run: cargo test -- --nocapture

Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ dotenvy = "0.15.3"
pretty_env_logger = "0.4.0"
futures = "0.3.13"
tokio = { version = "1", features = ["full"] }
# `migrate` is only needed by `#[sqlx::test]`, which gives each test its own
# freshly migrated database. Keeping it in dev-dependencies means it is not
# enabled for consumers of the library.
sqlx = { version = "0.9", default-features = false, features = ["migrate"] }
2 changes: 1 addition & 1 deletion sqlxmq_stress/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2018"
sqlxmq = { path = ".." }
tokio = { version = "1.4.0", features = ["full"] }
dotenvy = "0.15"
sqlx = "0.8"
sqlx = { version = "0.9", default-features = false, features = ["postgres"] }
serde = "1.0.125"
lazy_static = "1.4.0"
futures = "0.3.13"
1 change: 1 addition & 0 deletions sqlxmq_stress/migrations
12 changes: 0 additions & 12 deletions sqlxmq_stress/migrations/20210316025847_setup.down.sql

This file was deleted.

289 changes: 0 additions & 289 deletions sqlxmq_stress/migrations/20210316025847_setup.up.sql

This file was deleted.

2 changes: 0 additions & 2 deletions sqlxmq_stress/migrations/20210921115907_clear.down.sql

This file was deleted.

Loading
Loading