mirror of
https://github.com/kristoferssolo/zero2prod.git
synced 2025-10-21 20:10:40 +00:00
fix(workflows): fix sqlx-cli version
style: fix clippy warnings fix
This commit is contained in:
parent
4a2d00953c
commit
7871d95c1f
24
.github/workflows/CI.yml
vendored
24
.github/workflows/CI.yml
vendored
@ -2,7 +2,7 @@ name: Rust
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
SQLX_VERSION: 0.7
|
||||
SQLX_VERSION: 0.7.4
|
||||
SQLX_FEATURES: "rustls,postgres"
|
||||
jobs:
|
||||
test:
|
||||
@ -24,11 +24,11 @@ jobs:
|
||||
with:
|
||||
key: sqlx-${{ env.SQLX_VERSION }}
|
||||
- name: Install sqlx-cli
|
||||
run: cargo install sqlx-cli --version ${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||
- name: Install postgresql-client
|
||||
run: sudo apt-get update && sudo apt-get install -y postgresql-client
|
||||
run: cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||
- name: Migrate database
|
||||
run: SKIP_DOCKER=true ./scripts/init_db
|
||||
run: |
|
||||
sudo apt-get install libpq-dev -y
|
||||
SKIP_DOCKER=true ./scripts/init_db
|
||||
- name: Check sqlx-data.json is up to date
|
||||
run: cargo sqlx prepare --workspace --check
|
||||
- name: Run tests
|
||||
@ -65,10 +65,10 @@ jobs:
|
||||
key: sqlx-${{ env.SQLX_VERSION }}
|
||||
- name: Install sqlx-cli
|
||||
run: cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||
- name: Install postgresql-client
|
||||
run: sudo apt-get update && sudo apt-get install postgresql-client -y
|
||||
- name: Migrate database
|
||||
run: SKIP_DOCKER=true ./scripts/init_db
|
||||
run: |
|
||||
sudo apt-get install libpq-dev -y
|
||||
SKIP_DOCKER=true ./scripts/init_db
|
||||
- name: Linting
|
||||
run: cargo clippy -- -D warnings
|
||||
coverage:
|
||||
@ -87,14 +87,16 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install postgresql-client
|
||||
run: sudo apt-get update && sudo apt-get install postgresql-client -y
|
||||
- name: Install libpq
|
||||
run: sudo apt-get update && sudo apt-get install -y postgresql-client
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: sqlx-${{ env.SQLX_VERSION }}
|
||||
- name: Install tarpaulin
|
||||
run: cargo install cargo-tarpaulin
|
||||
- name: Install sqlx-cli
|
||||
run: cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||
- name: Migrate database
|
||||
run: SKIP_DOCKER=true ./scripts/init_db
|
||||
- name: Generate code coverage
|
||||
run: cargo install cargo-tarpaulin && cargo tarpaulin --verbose --workspace
|
||||
run: cargo tarpaulin --verbose --workspace
|
||||
|
||||
@ -13,7 +13,7 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
init_subscriber(subscriber);
|
||||
let config = get_config().expect("Failed to read configuation.");
|
||||
let pool = PgPoolOptions::new()
|
||||
.connect_lazy(&config.database.to_string().expose_secret())
|
||||
.connect_lazy(config.database.to_string().expose_secret())
|
||||
.expect("Failed to create Postgres connection pool.");
|
||||
let addr = format!("{}:{}", config.application.host, config.application.port);
|
||||
let listener = TcpListener::bind(addr)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user