Skip to content

Commit

Permalink
feat: support database tests in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasauler committed Sep 30, 2024
1 parent bed3e9b commit a6d19fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ jobs:
coverage:
docker:
- image: cimg/rust:1.81.0
environment:
DATABASE_URL: postgresql://postgres@localhost/circle_test
steps:
- checkout
- run:
Expand All @@ -158,6 +160,14 @@ jobs:
name: Install nextest
command: |
curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- run:
name: Install sqlx-cli
command: cargo install sqlx-cli
- run:
name: Database setup
command: |
sqlx database create
sqlx migrate run
- run:
name: Setup test.env
command: |
Expand All @@ -167,8 +177,6 @@ jobs:
name: Running code coverage
command: |
rustup run nightly cargo llvm-cov nextest --locked --all-features --lcov --output-path lcov.info
environment:
DATABASE_URL: postgresql://postgres@localhost/circle_test
- codecov/upload:
file: "./lcov.info"
# token: $CODECOV_TOKEN already default
Expand Down Expand Up @@ -231,10 +239,11 @@ workflows:
filters:
tags:
only: /.*/
- shuttle-deploy:
requires:
- doc
- coverage
filters:
branches:
only: main
# skipping auto deploy for now
# - shuttle-deploy:
# requires:
# - doc
# - coverage
# filters:
# branches:
# only: main
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
buildInputs = [
bacon
cargo-expand
cargo-llvm-cov
cargo-nextest
cargo-watch
jq
Expand Down

0 comments on commit a6d19fc

Please sign in to comment.