mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-01 17:34:25 +02:00
Add a cargo workspace containing both crates (#321)
* Move Cargo.toml for exercises to exercises directory. * Create a workspace with both exercises and i18n-helpers. * Build in CI as well as testing. * Binaries must have a main function. * No need for workspaces configuration for caching anymore.
This commit is contained in:
parent
a07bfa108f
commit
20f02db5f5
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -34,13 +34,12 @@ jobs:
|
||||
- name: Setup Rust cache
|
||||
uses: ./.github/workflows/setup-rust-cache
|
||||
|
||||
- name: Build Rust code
|
||||
run: cargo build
|
||||
|
||||
- name: Test Rust code
|
||||
run: cargo test
|
||||
|
||||
- name: Test i18n-helpers
|
||||
run: cargo test
|
||||
working-directory: i18n-helpers
|
||||
|
||||
i18n-helpers:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -7,7 +7,3 @@ runs:
|
||||
steps:
|
||||
- name: Setup Rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
. -> target
|
||||
i18n-helpers -> target
|
||||
|
1200
Cargo.lock
generated
1200
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
54
Cargo.toml
54
Cargo.toml
@ -1,49 +1,5 @@
|
||||
[package]
|
||||
name = "comprehensive-rust"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[[bin]]
|
||||
name = "for-loops"
|
||||
path = "src/exercises/day-1/for-loops.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "book-library"
|
||||
path = "src/exercises/day-1/book-library.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "points-polygons"
|
||||
path = "src/exercises/day-2/points-polygons.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "luhn"
|
||||
path = "src/exercises/day-2/luhn.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "strings-iterators"
|
||||
path = "src/exercises/day-2/strings-iterators.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "safe-ffi-wrapper"
|
||||
path = "src/exercises/day-3/safe-ffi-wrapper.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "simple-gui"
|
||||
path = "src/exercises/day-3/simple-gui.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "dining-philosophers"
|
||||
path = "src/exercises/day-4/dining-philosophers.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "link-checker"
|
||||
path = "src/exercises/day-4/link-checker.rs"
|
||||
|
||||
|
||||
[dependencies]
|
||||
reqwest = { version = "0.11.12", features = ["blocking"] }
|
||||
scraper = "0.13.0"
|
||||
thiserror = "1.0.37"
|
||||
[workspace]
|
||||
members = [
|
||||
"i18n-helpers",
|
||||
"src/exercises",
|
||||
]
|
||||
|
1941
i18n-helpers/Cargo.lock
generated
1941
i18n-helpers/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
46
src/exercises/Cargo.toml
Normal file
46
src/exercises/Cargo.toml
Normal file
@ -0,0 +1,46 @@
|
||||
[package]
|
||||
name = "comprehensive-rust"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[[bin]]
|
||||
name = "for-loops"
|
||||
path = "day-1/for-loops.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "book-library"
|
||||
path = "day-1/book-library.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "points-polygons"
|
||||
path = "day-2/points-polygons.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "luhn"
|
||||
path = "day-2/luhn.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "strings-iterators"
|
||||
path = "day-2/strings-iterators.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "safe-ffi-wrapper"
|
||||
path = "day-3/safe-ffi-wrapper.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "simple-gui"
|
||||
path = "day-3/simple-gui.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "dining-philosophers"
|
||||
path = "day-4/dining-philosophers.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "link-checker"
|
||||
path = "day-4/link-checker.rs"
|
||||
|
||||
[dependencies]
|
||||
reqwest = { version = "0.11.12", features = ["blocking"] }
|
||||
scraper = "0.13.0"
|
||||
thiserror = "1.0.37"
|
@ -222,3 +222,5 @@ mod tests {
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: unit-tests
|
||||
|
||||
fn main() {}
|
||||
|
@ -6,7 +6,4 @@
|
||||
|
||||
```rust
|
||||
{{#include points-polygons.rs}}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn main() {}
|
||||
```
|
||||
|
@ -68,3 +68,5 @@ fn test_matches_with_wildcard() {
|
||||
));
|
||||
}
|
||||
// ANCHOR_END: unit-tests
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user