Skip to content

Commit a666855

Browse files
committed
Merge branch 'master' into tn12
2 parents e76968e + ceca528 commit a666855

File tree

2 files changed

+54
-64
lines changed

2 files changed

+54
-64
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@ jobs:
1818
- name: Install stable toolchain
1919
uses: dtolnay/rust-toolchain@stable
2020

21-
- name: Cache
22-
uses: actions/cache@v4
23-
with:
24-
path: |
25-
~/.cargo/bin/
26-
~/.cargo/registry/index/
27-
~/.cargo/registry/cache/
28-
~/.cargo/git/db/
29-
target/
30-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
21+
- name: Set up cache
22+
uses: Swatinem/rust-cache@v2
3123

3224
- name: Run cargo check
3325
run: cargo check --tests --workspace --benches
@@ -104,17 +96,6 @@ jobs:
10496
with:
10597
tool: cargo-nextest
10698

107-
- name: Cache
108-
uses: actions/cache@v4
109-
with:
110-
path: |
111-
~/.cargo/bin/
112-
~/.cargo/registry/index/
113-
~/.cargo/registry/cache/
114-
~/.cargo/git/db/
115-
target/
116-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
117-
11899
- name: Run cargo build with devnet-prealloc feature
119100
run: cargo build --features devnet-prealloc --workspace --all --tests --benches
120101

@@ -202,16 +183,8 @@ jobs:
202183
with:
203184
components: rustfmt, clippy
204185

205-
- name: Cache
206-
uses: actions/cache@v4
207-
with:
208-
path: |
209-
~/.cargo/bin/
210-
~/.cargo/registry/index/
211-
~/.cargo/registry/cache/
212-
~/.cargo/git/db/
213-
target/
214-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
186+
- name: Set up cache
187+
uses: Swatinem/rust-cache@v2
215188

216189
- name: Run cargo fmt
217190
run: cargo fmt --all -- --check
@@ -261,16 +234,8 @@ jobs:
261234
- name: Add wasm32 target
262235
run: rustup target add wasm32-unknown-unknown
263236

264-
- name: Cache
265-
uses: actions/cache@v4
266-
with:
267-
path: |
268-
~/.cargo/bin/
269-
~/.cargo/registry/index/
270-
~/.cargo/registry/cache/
271-
~/.cargo/git/db/
272-
target/
273-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
237+
- name: Set up cache
238+
uses: Swatinem/rust-cache@v2
274239

275240
# append here any new wasm32 crate not already covered by the existing checks
276241

@@ -341,16 +306,8 @@ jobs:
341306
- name: Install NodeJS dependencies
342307
run: npm install --global typedoc typescript
343308

344-
- name: Cache
345-
uses: actions/cache@v4
346-
with:
347-
path: |
348-
~/.cargo/bin/
349-
~/.cargo/registry/index/
350-
~/.cargo/registry/cache/
351-
~/.cargo/git/db/
352-
target/
353-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
309+
- name: Set up cache
310+
uses: Swatinem/rust-cache@v2
354311

355312
- name: Build wasm release
356313
run: |
@@ -379,19 +336,9 @@ jobs:
379336
- name: Install stable toolchain
380337
uses: dtolnay/rust-toolchain@stable
381338

382-
- name: Cache Cargo Build Outputs
383-
uses: actions/cache@v4
384-
with:
385-
path: |
386-
~/.cargo/bin/
387-
~/.cargo/registry/index/
388-
~/.cargo/registry/cache/
389-
~/.cargo/git/db/
390-
target/
391-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
392-
restore-keys: |
393-
${{ runner.os }}-cargo-
394-
339+
- name: Set up Rust cache
340+
uses: Swatinem/rust-cache@v2
341+
395342
- name: Cache Toolchain
396343
uses: actions/cache@v4
397344
with:

Cargo.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,49 @@ inherits = "release"
355355
debug = true
356356
strip = false
357357

358+
# CI optimization: Keep debug fast to compile, but optimize hot-path crates
359+
# so tests run at reasonable speed without full release builds.
360+
361+
[profile.dev.package.kaspa-consensus]
362+
opt-level = 2
363+
364+
[profile.dev.package.kaspa-consensus-core]
365+
opt-level = 2
366+
367+
[profile.dev.package.kaspa-hashes]
368+
opt-level = 2
369+
370+
[profile.dev.package.kaspa-math]
371+
opt-level = 2
372+
373+
[profile.dev.package.kaspa-muhash]
374+
opt-level = 2
375+
376+
[profile.dev.package.kaspa-pow]
377+
opt-level = 2
378+
379+
[profile.dev.package.kaspa-txscript]
380+
opt-level = 2
381+
382+
# External crates used heavily by consensus/crypto
383+
[profile.dev.package.blake2b_simd]
384+
opt-level = 2
385+
386+
[profile.dev.package.rand_chacha]
387+
opt-level = 2
388+
389+
[profile.dev.package.malachite-base]
390+
opt-level = 2
391+
392+
[profile.dev.package.malachite-nz]
393+
opt-level = 2
394+
395+
[profile.dev.package.secp256k1]
396+
opt-level = 2
397+
398+
[profile.dev.package.sha2]
399+
opt-level = 2
400+
358401
[workspace.lints.clippy]
359402
empty_docs = "allow"
360403
uninlined_format_args = "allow"

0 commit comments

Comments
 (0)