Skip to content

feat: added sccache to workflow and dockerfile (#12) #27

feat: added sccache to workflow and dockerfile (#12)

feat: added sccache to workflow and dockerfile (#12) #27

Workflow file for this run

name: Check Set-Up & Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-22.04
concurrency:
group: rust-check
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
# Cache cargo's registry
- name: Rust registry cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: registry-main-cache
cache-targets: false
cache-on-failure: true
cache-all-crates: false
save-if: ${{ github.ref_name == 'main' }}
- name: Install Rust
run: |
rustup set profile minimal
rustup show
- name: Ensure the code is formatted
id: fmt
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: fmt
args: -- --check
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: 3.20.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install sccache
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: "agicommies-subspace-cache"
SCCACHE_ENDPOINT: ${{ vars.SCCACHE_ENDPOINT }}
SCCACHE_REGION: auto
run: |
curl https://github.com/mozilla/sccache/releases/download/v0.7.6/sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz \
-Lo sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz
tar -xzf sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz --strip-components=1 sccache-v0.7.6-x86_64-unknown-linux-musl/sccache
./sccache --start-server
echo "RUSTC_WRAPPER=${{ github.workspace }}/sccache" >> "$GITHUB_ENV"
- name: Ensure Clippy is happy
id: clippy
uses: actions-rs/clippy-check@v1
continue-on-error: true
with:
args: --color=always --all-features --timings -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- run: ${{ github.workspace }}/sccache --show-stats
- name: Run tests
run: |
cargo test