Skip to content

Commit

Permalink
ci: cache builds with sccache
Browse files Browse the repository at this point in the history
  • Loading branch information
soopyc committed Mar 21, 2024
1 parent f2b505d commit f64de6d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
name: "Build documentation"

permissions:
contents: read
pages: write
Expand All @@ -9,13 +11,28 @@ on:
branches:
- main

jobs:
env:
SCCACHE_VERSION: v0.7.7

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Obtain sccache
run: |
curl -fsSL https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz \
| tar xz sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache --strip=1
- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('RUSTC_WRAPPER', './sccache')
core.exportVariable('SCCACHE_GHA_ENABLED', 'on')
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install mdBook and dependencies
run: |
cargo install mdbook mdbook-admonish
Expand Down

0 comments on commit f64de6d

Please sign in to comment.