Skip to content

Commit

Permalink
Merge pull request #69 from Kijewski/pr-workspaces
Browse files Browse the repository at this point in the history
Move integration crates in their own workspaces
  • Loading branch information
GuillaumeGomez authored Jul 13, 2024
2 parents 24c91e1 + 429eae1 commit b2267da
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 24 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ['main']
branches: ['master']
pull_request:
schedule:
- cron: "32 4 * * 5"
Expand All @@ -24,9 +24,12 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-targets
- run: cargo test
- run: cargo nextest run

Package:
strategy:
Expand All @@ -38,20 +41,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- run: cd ${{ matrix.package }} && cargo test --all-targets
- run: cd ${{ matrix.package }} && cargo nextest run
- run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings

Lint:
Rustfmt:
runs-on: ubuntu-latest
steps:
# No need to test `rinja_derive_standalone`. It has same the `src` folder as `rinja_derive`.
# No need to run the checks in parallel. They are fast enough.
# No need for caching. No code is compiled at all.
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets -- -D warnings
components: rustfmt
- run: |
set -eu
for PKG in \
rinja rinja_actix rinja_axum rinja_derive rinja_derive_standalone \
rinja_parser rinja_rocket rinja_warp testing examples/actix-web-app
do
cd "$PKG"
echo "Testing: $PKG"
cargo fmt -- --check
cd -
done
MSRV:
runs-on: ubuntu-latest
Expand Down
11 changes: 0 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
[workspace]
members = [
"rinja",
"rinja_actix",
"rinja_axum",
"rinja_derive",
"rinja_parser",
"rinja_rocket",
"rinja_warp",
"testing",
]
resolver = "2"

default-members = [
"rinja",
"rinja_derive",
"rinja_parser",
"testing",
]
4 changes: 3 additions & 1 deletion rinja_actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ categories = ["template-engine"]
homepage = "https://github.com/rinja-rs/rinja"
repository = "https://github.com/rinja-rs/rinja"
license = "MIT OR Apache-2.0"
workspace = ".."
readme = "README.md"
edition = "2021"
rust-version = "1.71"
Expand All @@ -29,3 +28,6 @@ humansize = ["rinja/humansize"]
num-traits = ["rinja/num-traits"]
serde_json = ["rinja/serde_json"]
urlencode = ["rinja/urlencode"]

[workspace]
members = ["."]
4 changes: 3 additions & 1 deletion rinja_axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ homepage = "https://github.com/rinja-rs/rinja"
repository = "https://github.com/rinja-rs/rinja"
documentation = "https://docs.rs/rinja"
license = "MIT OR Apache-2.0"
workspace = ".."
readme = "README.md"

[dependencies]
Expand All @@ -31,3 +30,6 @@ humansize = ["rinja/humansize"]
num-traits = ["rinja/num-traits"]
serde_json = ["rinja/serde_json"]
urlencode = ["rinja/urlencode"]

[workspace]
members = ["."]
4 changes: 3 additions & 1 deletion rinja_rocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ categories = ["template-engine"]
homepage = "https://github.com/rinja-rs/rinja"
repository = "https://github.com/rinja-rs/rinja"
license = "MIT OR Apache-2.0"
workspace = ".."
readme = "README.md"
edition = "2021"
rust-version = "1.71"
Expand All @@ -27,3 +26,6 @@ humansize = ["rinja/humansize"]
num-traits = ["rinja/num-traits"]
serde_json = ["rinja/serde_json"]
urlencode = ["rinja/urlencode"]

[workspace]
members = ["."]
4 changes: 3 additions & 1 deletion rinja_warp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ categories = ["template-engine"]
homepage = "https://github.com/rinja-rs/rinja"
repository = "https://github.com/rinja-rs/rinja"
license = "MIT OR Apache-2.0"
workspace = ".."
readme = "README.md"
edition = "2021"
rust-version = "1.71"
Expand All @@ -27,3 +26,6 @@ humansize = ["rinja/humansize"]
num-traits = ["rinja/num-traits"]
serde_json = ["rinja/serde_json"]
urlencode = ["rinja/urlencode"]

[workspace]
members = ["."]

0 comments on commit b2267da

Please sign in to comment.