Skip to content

Commit f77f30e

Browse files
committed
try new build flags for faster compile
1 parent d85e662 commit f77f30e

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/release.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Create release
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
run: gh release create ${{ github.ref_name }} --generate-notes --title "Version ${{ github.ref_name }}"
23+
run: gh release create ${{ github.ref_name }} --generate-notes --title "${{ github.ref_name }}"
2424

2525
upload-release:
2626
name: Build and Release
@@ -34,22 +34,27 @@ jobs:
3434
- uses: actions/checkout@v4
3535

3636
- name: Install Rust Toolchain
37-
uses: dtolnay/rust-toolchain@stable
37+
uses: dtolnay/rust-toolchain@nightly
3838

39-
- name: Print Runner OS
40-
run: echo "Runner OS is ${{ runner.os }}"
39+
- name: Install sccache
40+
run: |
41+
echo "Runner OS is ${{ runner.os }}"
42+
cargo install sccache
4143
4244
- name: Cache target dir
4345
uses: actions/cache@v3
4446
with:
4547
path: |
4648
target
49+
~/.cache/sccache
4750
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
4851
restore-keys: |
4952
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
5053
${{ runner.os }}-cargo-
5154
5255
- name: Build Release
56+
env:
57+
RUSTC_WRAPPER: sccache # Setting sccache as Rust compiler wrapper
5358
run: cargo build --release
5459

5560
- name: Archive Release Binary (Windows)

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ edition = "2021"
77
askama = "0.12.1"
88
clap = { version = "4.4.6", features = ["derive"] }
99
regex = "1.10.2"
10+
11+
[profile.dev]
12+
opt-level = 1
13+
14+
[profile.release]
15+
opt-level = 1
16+
17+
[build]
18+
rustflags = ["-Z", "threads=4"]
19+
rustc-wrapper = "sccache" # Use sccache for caching compilation

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ Example:
5151
cpa create --name myproject --preset python3.10
5252
```
5353

54+
Update current working directory with CPA preset.
55+
56+
```bash
57+
cpa update --preset python3.10
58+
```
59+
5460
# Goals
5561

5662
- **Speed up Project Creation**: Reduce the time spent on repetitive setup tasks

0 commit comments

Comments
 (0)