Skip to content

Commit

Permalink
Refer to workspace meta, Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Jun 21, 2023
1 parent 16b6ce4 commit 46d8c5f
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 284 deletions.
103 changes: 52 additions & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ commands:
command: |
cat\<< EOF > ~/.cargo/config.toml
[patch.crates-io]
shuttle-codegen = { path = "$PWD/shuttle/codegen" }
shuttle-common = { path = "$PWD/shuttle/common" }
shuttle-proto = { path = "$PWD/shuttle/proto" }
shuttle-runtime = { path = "$PWD/shuttle/runtime" }
shuttle-service = { path = "$PWD/shuttle/service" }
shuttle-codegen = { path = "$PWD/codegen" }
shuttle-common = { path = "$PWD/common" }
shuttle-proto = { path = "$PWD/proto" }
shuttle-runtime = { path = "$PWD/runtime" }
shuttle-service = { path = "$PWD/service" }
shuttle-aws-rds = { path = "$PWD/resources/aws-rds" }
shuttle-persist = { path = "$PWD/resources/persist" }
Expand Down Expand Up @@ -178,24 +178,28 @@ jobs:
steps:
- checkout
- restore-cargo-cache
# Check this to make sure we do not include patched dependencies in
# the Cargo.lock.
# Check this to make sure we do not include patched dependencies in the Cargo.lock.
- run:
command: |
[[ -z $(cat Cargo.lock | grep "\[\[patch.unused\]\]") ]]
[ -z $(grep "\[\[patch.unused\]\]" Cargo.lock) ]
- run: cargo fmt --all --check
# TODO: this is incompatible with workspace inheritance, uncomment when
# https://github.com/DevinR528/cargo-sort/pull/29 is merged
# - run: cargo install cargo-sort
# - run: cargo sort --check --workspace
- run: |
cargo clippy --tests \
--all-targets \
--all-features \
--no-deps -- \
--D warnings \
-A clippy::let-unit-value \
-A clippy::format-push-string
- run: cargo clippy --tests --all-targets --all-features --no-deps -- --D warnings
- save-cargo-cache
test-member:
parameters:
crate:
description: "Crate in workspace to test"
type: string
executor: docker-rust
steps:
- checkout
- restore-cargo-cache
- apply-patches
- run: cargo test --package << parameters.crate >> --all-features -- --nocapture
- save-cargo-cache
check-standalone:
parameters:
Expand All @@ -222,9 +226,7 @@ jobs:
<< parameters.features >> \
--manifest-path << parameters.path >>/Cargo.toml \
--no-deps -- \
--D warnings \
-A clippy::let-unit-value \
-A clippy::format-push-string
--D warnings
- run: cargo test << parameters.features >> --manifest-path << parameters.path >>/Cargo.toml -- --nocapture
- save-cargo-cache
platform-test:
Expand Down Expand Up @@ -599,35 +601,36 @@ workflows:
ci:
jobs:
- workspace
- check-standalone:
name: << matrix.path >>
- test-member:
name: << matrix.crate >>
matrix:
parameters:
path:
- resources/aws-rds
- resources/persist
- resources/secrets
- resources/static-folder
- services/shuttle-actix-web
- services/shuttle-axum
- services/shuttle-next
- services/shuttle-poem
- services/shuttle-poise
- services/shuttle-rocket
- services/shuttle-salvo
- services/shuttle-serenity
- services/shuttle-thruster
- services/shuttle-tide
- services/shuttle-tower
- services/shuttle-warp
crate:
- shuttle-persist
- shuttle-secrets
- shuttle-static-folder
- shuttle-actix-web
- shuttle-axum
- shuttle-next
- shuttle-poem
- shuttle-poise
- shuttle-rocket
- shuttle-salvo
- shuttle-serenity
- shuttle-thruster
- shuttle-tide
- shuttle-tower
- shuttle-warp
- check-standalone:
# shuttle-shared-db has mutually exclusive features
# so we run checks for each feature separately
name: "resources/shared-db: << matrix.features >>"
matrix:
alias: check-standalone-shared-db
parameters:
path: [resources/shared-db]
path:
# resources/aws-rds has no tests, but also has mutually exclusive features
- resources/shared-db
features:
- "-F mongodb"
- "-F postgres"
Expand All @@ -639,21 +642,19 @@ workflows:
matrix:
parameters:
crate:
[
"shuttle-auth",
"cargo-shuttle",
"shuttle-codegen",
"shuttle-common",
"shuttle-deployer",
"shuttle-proto",
"shuttle-provisioner",
"shuttle-runtime",
"shuttle-service"
]
- shuttle-auth
- cargo-shuttle
- shuttle-codegen
- shuttle-common
- shuttle-deployer
- shuttle-proto
- shuttle-provisioner
- shuttle-runtime
- shuttle-service
- e2e-test:
requires:
- platform-test
- check-standalone
- test-member
- check-standalone-shared-db
filters:
branches:
Expand Down
Loading

0 comments on commit 46d8c5f

Please sign in to comment.