Skip to content

Commit 7940612

Browse files
authored
Clean up CI workflow (#8)
* cache artifacts and remove duplicate build step * remove `release` flag * do not use parallel threads
1 parent 9ade76a commit 7940612

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

.github/workflows/test-build.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55

66
env:
77
CARGO_TERM_COLOR: always
8+
CARGO_NET_RETRY: 10
9+
RUSTC_WRAPPER: sccache
10+
RUST_BACKTRACE: 1
11+
# Enable parallel compilation
12+
RUSTC_PARALLEL_COMPILER: true
813

914
jobs:
1015
build:
@@ -15,11 +20,11 @@ jobs:
1520
os: [macos-14, macos-latest, windows-latest]
1621
include:
1722
- os: macos-14
18-
name: "macOS ARM"
23+
name: 'macOS ARM'
1924
- os: macos-latest
20-
name: "macOS x86"
25+
name: 'macOS x86'
2126
- os: windows-latest
22-
name: "Windows"
27+
name: 'Windows'
2328

2429
runs-on: ${{ matrix.os }}
2530

@@ -28,8 +33,30 @@ jobs:
2833
with:
2934
submodules: recursive
3035

31-
- name: Build
32-
run: cargo build
36+
# Install and setup sccache
37+
- name: Install sccache
38+
uses: mozilla-actions/[email protected]
39+
40+
# Setup Rust toolchain with caching
41+
- name: Setup Rust
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
profile: minimal
45+
toolchain: stable
46+
47+
# Cache dependencies and build outputs
48+
- name: Cache cargo registry
49+
uses: actions/cache@v3
50+
with:
51+
path: |
52+
~/.cargo/registry
53+
~/.cargo/git
54+
target
55+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
56+
restore-keys: |
57+
${{ runner.os }}-cargo-
3358
3459
- name: Run tests
35-
run: cargo test
60+
uses: actions-rs/cargo@v1
61+
with:
62+
command: test

0 commit comments

Comments
 (0)