Skip to content

Commit fe96026

Browse files
committed
Add sccache to build
1 parent 21c9d1a commit fe96026

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

.github/workflows/build-setup.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- name: Configure sccache
2+
run: |
3+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
4+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
5+
6+
- name: Run sccache-cache
7+
uses: mozilla-actions/[email protected]
8+
9+
- name: Rust Cache
10+
uses: Swatinem/rust-cache@v2
11+
with:
12+
prefix-key: "v1-rust"
13+
shared-key: "${{ matrix.target }}-build"
14+
cache-targets: "true"
15+
cache-on-failure: "true"
16+
cache-all-crates: "true"
17+
save-if: ${{ github.ref == 'refs/heads/master' }}
18+
workspaces: |
19+
. -> target

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ jobs:
117117
- uses: actions/checkout@v4
118118
with:
119119
submodules: recursive
120+
- name: "Configure sccache"
121+
run: |
122+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
123+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
124+
- name: "Run sccache-cache"
125+
uses: "mozilla-actions/[email protected]"
126+
- name: "Rust Cache"
127+
uses: "Swatinem/rust-cache@v2"
128+
with:
129+
"cache-all-crates": "true"
130+
"cache-on-failure": "true"
131+
"cache-targets": "true"
132+
"prefix-key": "v1-rust"
133+
"save-if": "${{ github.ref == 'refs/heads/master' }}"
134+
"shared-key": "${{ matrix.target }}-build"
135+
"workspaces": ". -> target\n"
120136
- name: Install dist
121137
run: ${{ matrix.install_dist }}
122138
# Get the dist-manifest

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ path-guid = "8CE721BB-AC0D-4C60-9853-90F230FEA7EA"
1212
license = false
1313
eula = false
1414

15-
1615
[profile.release]
1716
lto = true
1817
opt-level = "z"
@@ -21,7 +20,6 @@ opt-level = "z"
2120
[profile.dist]
2221
inherits = "release"
2322
lto = "thin"
24-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2523

2624
[dependencies]
2725
reqwest = { version = "0.12", features = [

dist-workspace.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ ci = "github"
1010
# The installers to generate for each app
1111
installers = ["shell", "powershell", "homebrew", "msi"]
1212
# Target platforms to build apps for (Rust target-triple syntax)
13-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
13+
targets = [
14+
"aarch64-apple-darwin",
15+
"x86_64-apple-darwin",
16+
"x86_64-unknown-linux-gnu",
17+
"x86_64-unknown-linux-musl",
18+
"x86_64-pc-windows-msvc",
19+
]
1420
# A GitHub repo to push Homebrew formulas to
1521
tap = "BitpingApp/homebrew-tap"
1622
# Path that installers should place binaries in
@@ -19,3 +25,4 @@ install-path = "CARGO_HOME"
1925
publish-jobs = ["homebrew"]
2026
# Whether to install an updater program
2127
install-updater = true
28+
github-build-setup = "build-setup.yml"

0 commit comments

Comments
 (0)