Skip to content

Commit

Permalink
try new build flags for faster compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ysawa0 committed Nov 10, 2023
1 parent d85e662 commit f77f30e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f77f30e

Please sign in to comment.