From c6383874e94ebd770ec09b4efe1f123811684c02 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Mon, 16 May 2022 16:02:11 +1200 Subject: [PATCH] Try removing debuginfo for ci builds (#5549) * Try removing debuginfo for ci builds * oops, wrong inherits * extra flag * nextest doesn't support --profile in the same way * try to allow for a ci-specific target * Oops, run more tests --- .github/workflows/ci.yml | 31 +++++++++++++++++++++---------- Cargo.toml | 7 +++++++ crates/nu-test-support/src/fs.rs | 7 +++++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56c9657e8..fca31bd8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,15 @@ name: continuous-integration jobs: nu-fmt-clippy: strategy: - fail-fast: false + fail-fast: true matrix: platform: [windows-latest, macos-latest, ubuntu-latest] rust: - stable runs-on: ${{ matrix.platform }} + env: + NUSHELL_CARGO_TARGET: ci steps: - uses: actions/checkout@v2 @@ -45,8 +47,11 @@ jobs: args: --features=extra --workspace --exclude nu_plugin_* -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect nu-tests: + env: + NUSHELL_CARGO_TARGET: ci + strategy: - fail-fast: false + fail-fast: true matrix: platform: [windows-latest, macos-latest, ubuntu-latest] style: [extra, default] @@ -79,23 +84,26 @@ jobs: with: key: ${{ matrix.style }}v1 # increment this to bust the cache if needed - - uses: taiki-e/install-action@nextest + # - uses: taiki-e/install-action@nextest - name: Tests uses: actions-rs/cargo@v1 with: - command: nextest - args: run --workspace --exclude nu_plugin_* ${{ matrix.flags }} + command: test + args: --workspace --profile ci --exclude nu_plugin_* ${{ matrix.flags }} - name: Doctests uses: actions-rs/cargo@v1 with: command: test - args: --workspace --exclude nu_plugin_* --doc ${{ matrix.flags }} + args: --workspace --profile ci --exclude nu_plugin_* --doc ${{ matrix.flags }} python-virtualenv: + env: + NUSHELL_CARGO_TARGET: ci + strategy: - fail-fast: false + fail-fast: true matrix: platform: [ubuntu-latest, macos-latest, windows-latest] rust: @@ -123,7 +131,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: install - args: --path=. --no-default-features --debug + args: --path=. --profile ci --no-default-features - name: Setup Python uses: actions/setup-python@v2 @@ -146,8 +154,11 @@ jobs: # Build+test plugins on their own, without the rest of Nu. This helps with CI parallelization and # also helps test that the plugins build without any feature unification shenanigans plugins: + env: + NUSHELL_CARGO_TARGET: ci + strategy: - fail-fast: false + fail-fast: true matrix: platform: [windows-latest, macos-latest, ubuntu-latest] rust: @@ -175,4 +186,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --package nu_plugin_* + args: --profile ci --package nu_plugin_* diff --git a/Cargo.toml b/Cargo.toml index 8a877c1a7..094b4330d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,6 +103,13 @@ inherits = "release" strip = false debug = true +# build with `cargo build --profile ci` +# to analyze performance with tooling like linux perf +[profile.ci] +inherits = "dev" +strip = false +debug = false + # Main nu binary [[bin]] name = "nu" diff --git a/crates/nu-test-support/src/fs.rs b/crates/nu-test-support/src/fs.rs index dbdd2168d..909e2ebd7 100644 --- a/crates/nu-test-support/src/fs.rs +++ b/crates/nu-test-support/src/fs.rs @@ -246,9 +246,12 @@ pub fn root() -> PathBuf { } pub fn binaries() -> PathBuf { - let mut build_type = "debug"; + let mut build_type = "debug".to_string(); if !cfg!(debug_assertions) { - build_type = "release" + build_type = "release".to_string() + } + if let Ok(target) = std::env::var("NUSHELL_CARGO_TARGET") { + build_type = target; } std::env::var("CARGO_TARGET_DIR")