From f77f30e3a2fe96a1d60ac32ac2bf8118f303ce8c Mon Sep 17 00:00:00 2001 From: Yuki Sawa Date: Fri, 10 Nov 2023 13:34:25 -0800 Subject: [PATCH] try new build flags for faster compile --- .github/workflows/release.yaml | 13 +++++++++---- Cargo.toml | 10 ++++++++++ README.md | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6abcf73..ea31e32 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,7 +20,7 @@ jobs: - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release create ${{ github.ref_name }} --generate-notes --title "Version ${{ github.ref_name }}" + run: gh release create ${{ github.ref_name }} --generate-notes --title "${{ github.ref_name }}" upload-release: name: Build and Release @@ -34,22 +34,27 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@nightly - - name: Print Runner OS - run: echo "Runner OS is ${{ runner.os }}" + - name: Install sccache + run: | + echo "Runner OS is ${{ runner.os }}" + cargo install sccache - name: Cache target dir uses: actions/cache@v3 with: path: | target + ~/.cache/sccache key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} ${{ runner.os }}-cargo- - name: Build Release + env: + RUSTC_WRAPPER: sccache # Setting sccache as Rust compiler wrapper run: cargo build --release - name: Archive Release Binary (Windows) diff --git a/Cargo.toml b/Cargo.toml index 9e241dc..a8cfada 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,13 @@ edition = "2021" askama = "0.12.1" clap = { version = "4.4.6", features = ["derive"] } regex = "1.10.2" + +[profile.dev] +opt-level = 1 + +[profile.release] +opt-level = 1 + +[build] +rustflags = ["-Z", "threads=4"] +rustc-wrapper = "sccache" # Use sccache for caching compilation diff --git a/README.md b/README.md index 7e4f7d1..e569f9f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,12 @@ Example: cpa create --name myproject --preset python3.10 ``` +Update current working directory with CPA preset. + +```bash +cpa update --preset python3.10 +``` + # Goals - **Speed up Project Creation**: Reduce the time spent on repetitive setup tasks