diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d529701..72b5ad9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,14 @@ jobs: - uses: actions/checkout@main - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - - name: Run `cargo check` - run: nix develop --command cargo check + - name: Set up nix dev env + run: nix develop --command echo 0 + - name: Run `cargo build` + run: nix develop --command cargo build - name: Run `cargo clippy` run: nix develop --command cargo clippy --all-targets -- -D warnings + - name: Run `cargo test` + run: nix develop --command cargo test - name: Run `cargo fmt` run: nix develop --command cargo fmt --check - name: Run `nix fmt` diff --git a/src/main.rs b/src/main.rs index 61753d8..f2c9701 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ struct Cli { )] show_unwind_info: Option, /// Show build ID for given binary - #[arg(long, value_name = "PATH_TO_BINARY", + #[arg(long, value_name = "PATH_TO_BINARY", conflicts_with_all = ["pids", "tids", "duration", "filter_logs", "sample_freq", "flamegraph_file"] )] @@ -163,7 +163,7 @@ mod tests { cmd.arg("--help"); let expected = expect![[r#" - "Usage: lightswitch [OPTIONS]\n\nOptions:\n --pids \n Specific PIDs to profile\n --tids \n Specific TIDs to profile (these can be outside the PIDs selected above)\n --show-unwind-info \n Show unwind info for given binary\n --show-info \n Show build ID for given binary\n -D, --duration \n How long this agent will run in seconds [default: 18446744073709551615]\n --filter-logs\n \n --sample-freq \n Per-CPU Sampling Frequency in Hz [default: 19]\n --flamegraph-file \n Output file for Flame Graph in SVG format [default: flame.svg]\n -h, --help\n Print help\n" + "Usage: lightswitch [OPTIONS]\n\nOptions:\n --pids \n Specific PIDs to profile\n --tids \n Specific TIDs to profile (these can be outside the PIDs selected above)\n --show-unwind-info \n Show unwind info for given binary\n --show-info \n Show build ID for given binary\n -D, --duration \n How long this agent will run in seconds [default: 18446744073709551615]\n --filter-logs\n Enable TRACE (max) level logging - defaults to INFO level otherwise\n --sample-freq \n Per-CPU Sampling Frequency in Hz [default: 19]\n --flamegraph-file \n Output file for Flame Graph in SVG format [default: flame.svg]\n -h, --help\n Print help\n" "#]]; cmd.assert().success(); let actual = String::from_utf8(cmd.unwrap().stdout).unwrap();