Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support run, test and bench cargo commands #143

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
52dfd3d
feat: support run, test and bench cargo commands
eduardomourar Sep 21, 2023
acb6359
feat: take into account cargo config toml
eduardomourar Sep 22, 2023
951188c
chore: update comments
eduardomourar Sep 22, 2023
d03172c
chore: include tests for test command
eduardomourar Sep 22, 2023
6d0f54e
chore: include tests for bench command
eduardomourar Sep 22, 2023
213a12b
chore(ci): run tests with rust nightly
eduardomourar Sep 22, 2023
9c44908
feat: componentize output before command
eduardomourar Sep 28, 2023
fea81fc
chore: add test for run command
eduardomourar Sep 28, 2023
65d8f09
chore(ci): simplify tests and github workflow
eduardomourar Sep 28, 2023
fb638ed
chore(ci): disable fail fast strategy
eduardomourar Sep 28, 2023
9e227c0
chore(ci): ensure rust nightly is installed
eduardomourar Sep 28, 2023
0668d00
chore(ci): free space in rust installation
eduardomourar Sep 28, 2023
2114c11
chore: install clippy and rustfmt
eduardomourar Sep 28, 2023
2c76404
chore: use nightly when compiling bench test itself
eduardomourar Sep 29, 2023
799f8da
chore: set rust toolchain to nightly with env
eduardomourar Sep 29, 2023
a59a6ab
chore: disable benchmark test on windows
eduardomourar Sep 30, 2023
801be5b
feat: extract build details properly
eduardomourar Sep 30, 2023
b8f8fc6
fix: split runtime arguments to pass to runner
eduardomourar Sep 30, 2023
45d12ce
chore: add tests for command and reactor components
eduardomourar Sep 30, 2023
3fc25d2
fix: hide json message in stdout by default
eduardomourar Sep 30, 2023
36e908c
fix: test entrypoint clashing with command
eduardomourar Oct 2, 2023
d96f743
chore: simplify main github workflow
eduardomourar Oct 2, 2023
65c183f
chore: include some extra code comments
eduardomourar Oct 2, 2023
ece9d48
fix: missing ansi colors in command output
eduardomourar Oct 2, 2023
2af81a3
chore: use package id for binaries
eduardomourar Oct 9, 2023
7aa84a5
Improve the UX for supporting the run/test commands.
peterhuene Dec 4, 2023
bcfc884
Revert unnecessary test changes.
peterhuene Dec 4, 2023
9c4c577
Use Wasmtime 15 in CI.
peterhuene Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown
run: |
rustup set profile minimal
rustup update stable --no-self-update
rustup update nightly --no-self-update
rustup default stable
rustup target add wasm32-wasi
rustup target add wasm32-wasi --toolchain nightly
rustup target add wasm32-unknown-unknown
shell: bash
- name: Install Wasmtime
run: cargo install wasmtime-cli --locked --features="component-model" --version 15.0.0
- name: Run all tests
run: cargo test --all

Expand Down
46 changes: 37 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ wit-component = { workspace = true }
wasm-metadata = { workspace = true }
parse_arg = { workspace = true }
cargo_metadata = { workspace = true }
cargo-config2 = { workspace = true }
libc = { workspace = true }
warg-protocol = { workspace = true }
warg-crypto = { workspace = true }
Expand All @@ -48,6 +49,7 @@ rand_core = { workspace = true }
rpassword = { workspace = true }
futures = { workspace = true }
bytes = { workspace = true }
which = { workspace = true }

[dev-dependencies]
assert_cmd = "2.0.12"
Expand Down Expand Up @@ -78,12 +80,13 @@ semver = "1.0.20"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
indexmap = "2.1.0"
url = { version = "2.4.1", features = ["serde"] }
url = { version = "2.5.0", features = ["serde"] }
wit-parser = "0.13.0"
wit-component = "0.18.2"
wasm-metadata = "0.10.13"
parse_arg = "0.1.4"
cargo_metadata = "0.18.1"
cargo-config2 = "0.1.16"
keyring = "2.0.5"
libc = "0.2.150"
owo-colors = "3.5.0"
Expand All @@ -96,5 +99,6 @@ bytes = "1.5.0"
proc-macro2 = "1.0.69"
quote = "1.0.33"
syn = "2.0.39"
which = "5.0.0"
wit-bindgen-rust = "0.14.0"
wit-bindgen-core = "0.14.0"
1 change: 1 addition & 0 deletions src/commands/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ impl PublishCommand {
quiet: self.common.quiet,
targets: self.target.clone().into_iter().collect(),
manifest_path: self.manifest_path.clone(),
message_format: None,
frozen: self.frozen,
locked: self.locked,
release: true,
Expand Down
8 changes: 8 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ pub struct CargoArguments {
pub targets: Vec<String>,
/// The --manifest-path argument.
pub manifest_path: Option<PathBuf>,
/// The `--message-format`` argument.
pub message_format: Option<String>,
/// The --frozen argument.
pub frozen: bool,
/// The --locked argument.
Expand Down Expand Up @@ -392,6 +394,7 @@ impl CargoArguments {
let mut args = Args::default()
.single("--color", "WHEN", Some('c'))
.single("--manifest-path", "PATH", None)
.single("--message-format", "FMT", None)
.multiple("--package", "SPEC", Some('p'))
.multiple("--target", "TRIPLE", None)
.flag("--release", Some('r'))
Expand Down Expand Up @@ -438,6 +441,7 @@ impl CargoArguments {
.unwrap()
.take_single()
.map(PathBuf::from),
message_format: args.get_mut("--message-format").unwrap().take_single(),
targets: args.get_mut("--target").unwrap().take_multiple(),
frozen: args.get("--frozen").unwrap().count() > 0,
locked: args.get("--locked").unwrap().count() > 0,
Expand Down Expand Up @@ -756,6 +760,7 @@ mod test {
quiet: false,
targets: Vec::new(),
manifest_path: None,
message_format: None,
release: false,
frozen: false,
locked: false,
Expand All @@ -773,6 +778,8 @@ mod test {
"--color=auto",
"--manifest-path",
"Cargo.toml",
"--message-format",
"json-render-diagnostics",
"--release",
"--package",
"package1",
Expand All @@ -798,6 +805,7 @@ mod test {
quiet: true,
targets: vec!["foo".to_string(), "bar".to_string()],
manifest_path: Some("Cargo.toml".into()),
message_format: Some("json-render-diagnostics".into()),
release: true,
frozen: true,
locked: true,
Expand Down
Loading