diff --git a/.github/workflows/build-artifacts-and-run-tests.yml b/.github/workflows/build-artifacts-and-run-tests.yml index 83d5984..cb3bf30 100644 --- a/.github/workflows/build-artifacts-and-run-tests.yml +++ b/.github/workflows/build-artifacts-and-run-tests.yml @@ -126,17 +126,18 @@ jobs: # there's no way to run tests for ARM64 Windows for now if: matrix.target != 'aarch64-pc-windows-msvc' run: | - ${{ env.CARGO }} +stable test --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS + ${{ env.CARGO }} +stable test --profile fast --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS - - name: Build artifacts (binary and completions) + - name: Build release artifacts (binary and completions) + if: ${{ inputs.upload_artifacts }} run: | ${{ env.CARGO }} +stable build --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS env: OUCH_ARTIFACTS_FOLDER: artifacts - - name: Upload artifacts - uses: actions/upload-artifact@v4 + - name: Upload release artifacts if: ${{ inputs.upload_artifacts }} + uses: actions/upload-artifact@v4 with: name: ouch-${{ matrix.target }}-${{ steps.concat-features.outputs.FEATURES }} path: | diff --git a/Cargo.toml b/Cargo.toml index e280682..c9459ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,8 +73,17 @@ default = ["use_zlib", "use_zstd_thin", "unrar"] use_zlib = ["flate2/zlib", "gzp/deflate_zlib", "zip/deflate-zlib"] use_zstd_thin = ["zstd/thin"] +# For generating binaries for releases [profile.release] lto = true codegen-units = 1 opt-level = 3 strip = true + +# When we need a fast binary that compiles slightly faster `release` (useful for CI) +[profile.fast] +inherits = "release" +lto = false +opt-level = 2 +incremental = true +codegen-units = 16