mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-12-18 05:56:35 +00:00
Update CI + update sqlx
This commit is contained in:
parent
f4ae2d2bab
commit
847bb8152a
3 changed files with 534 additions and 300 deletions
34
.github/workflows/general.yml
vendored
34
.github/workflows/general.yml
vendored
|
@ -4,6 +4,9 @@ on:
|
||||||
# NB: this differs from the book's project!
|
# NB: this differs from the book's project!
|
||||||
# These settings allow us to run this specific CI pipeline for PRs against
|
# These settings allow us to run this specific CI pipeline for PRs against
|
||||||
# this specific branch (a.k.a. book chapter).
|
# this specific branch (a.k.a. book chapter).
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- root-chapter-05
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
branches:
|
branches:
|
||||||
|
@ -18,7 +21,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres:12
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: postgres
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
steps:
|
steps:
|
||||||
|
@ -31,8 +38,8 @@ jobs:
|
||||||
- name: Migrate database
|
- name: Migrate database
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libpq-dev -y
|
sudo apt-get install libpq-dev -y
|
||||||
cargo install --version=0.1.0-beta.1 sqlx-cli --no-default-features --features postgres
|
cargo install --version=0.2.0 sqlx-cli --no-default-features --features postgres
|
||||||
SKIP_DOCKER=true cd chapter03-1 && ./scripts/init_db.sh
|
SKIP_DOCKER=true ./scripts/init_db.sh
|
||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
@ -58,7 +65,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres:12
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: postgres
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
steps:
|
steps:
|
||||||
|
@ -72,8 +83,8 @@ jobs:
|
||||||
- name: Migrate database
|
- name: Migrate database
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libpq-dev -y
|
sudo apt-get install libpq-dev -y
|
||||||
cargo install --version=0.1.0-beta.1 sqlx-cli --no-default-features --features postgres
|
cargo install --version=0.2.0 sqlx-cli --no-default-features --features postgres
|
||||||
SKIP_DOCKER=true cd chapter03-1 && ./scripts/init_db.sh
|
SKIP_DOCKER=true ./scripts/init_db.sh
|
||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
|
@ -84,7 +95,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres:12
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: postgres
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
steps:
|
steps:
|
||||||
|
@ -100,9 +115,8 @@ jobs:
|
||||||
- name: Migrate database
|
- name: Migrate database
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libpq-dev -y
|
sudo apt-get install libpq-dev -y
|
||||||
cargo install --version=0.1.0-beta.1 sqlx-cli --no-default-features --features postgres
|
cargo install --version=0.2.0 sqlx-cli --no-default-features --features postgres
|
||||||
SKIP_DOCKER=true cd chapter03-1 && ./scripts/init_db.sh
|
SKIP_DOCKER=true ./scripts/init_db.sh
|
||||||
|
|
||||||
- name: Run cargo-tarpaulin
|
- name: Run cargo-tarpaulin
|
||||||
uses: actions-rs/tarpaulin@v0.1
|
uses: actions-rs/tarpaulin@v0.1
|
||||||
with:
|
with:
|
||||||
|
|
796
Cargo.lock
generated
796
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -18,7 +18,7 @@ actix-rt = "1.1.1"
|
||||||
tokio = "0.2.22"
|
tokio = "0.2.22"
|
||||||
serde = "1.0.115"
|
serde = "1.0.115"
|
||||||
config = { version = "0.10.1", default-features = false, features = ["yaml"] }
|
config = { version = "0.10.1", default-features = false, features = ["yaml"] }
|
||||||
sqlx = { version = "0.4.0-beta.1", default-features = false, features = [ "runtime-tokio", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] }
|
sqlx = { version = "0.4.1", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] }
|
||||||
uuid = { version = "0.8.1", features = ["v4"] }
|
uuid = { version = "0.8.1", features = ["v4"] }
|
||||||
chrono = "0.4.15"
|
chrono = "0.4.15"
|
||||||
tracing = "0.1.19"
|
tracing = "0.1.19"
|
||||||
|
|
Loading…
Reference in a new issue