Skip to content

Commit

Permalink
Add sccache to build
Browse files Browse the repository at this point in the history
  • Loading branch information
Firaenix committed Nov 30, 2024
1 parent 21c9d1a commit fe96026
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: Configure sccache
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-rust"
shared-key: "${{ matrix.target }}-build"
cache-targets: "true"
cache-on-failure: "true"
cache-all-crates: "true"
save-if: ${{ github.ref == 'refs/heads/master' }}
workspaces: |
. -> target
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Configure sccache"
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: "Run sccache-cache"
uses: "mozilla-actions/[email protected]"
- name: "Rust Cache"
uses: "Swatinem/rust-cache@v2"
with:
"cache-all-crates": "true"
"cache-on-failure": "true"
"cache-targets": "true"
"prefix-key": "v1-rust"
"save-if": "${{ github.ref == 'refs/heads/master' }}"
"shared-key": "${{ matrix.target }}-build"
"workspaces": ". -> target\n"
- name: Install dist
run: ${{ matrix.install_dist }}
# Get the dist-manifest
Expand Down
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ path-guid = "8CE721BB-AC0D-4C60-9853-90F230FEA7EA"
license = false
eula = false


[profile.release]
lto = true
opt-level = "z"
Expand All @@ -21,7 +20,6 @@ opt-level = "z"
[profile.dist]
inherits = "release"
lto = "thin"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
reqwest = { version = "0.12", features = [
Expand Down
9 changes: 8 additions & 1 deletion dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "homebrew", "msi"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
]
# A GitHub repo to push Homebrew formulas to
tap = "BitpingApp/homebrew-tap"
# Path that installers should place binaries in
Expand All @@ -19,3 +25,4 @@ install-path = "CARGO_HOME"
publish-jobs = ["homebrew"]
# Whether to install an updater program
install-updater = true
github-build-setup = "build-setup.yml"

0 comments on commit fe96026

Please sign in to comment.