Skip to content

Commit

Permalink
feat: add sccache to the build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sassman committed Jun 29, 2024
1 parent 9429cb9 commit cceee77
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
schedule:
- cron: '5 16 * * 6'

env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
test_features:
runs-on: ubuntu-latest
Expand All @@ -19,9 +24,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
uses: mozilla-actions/[email protected]
- name: build
run: cargo build -v --no-default-features --features "$FEATURES"
env:
Expand Down Expand Up @@ -52,9 +55,7 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
uses: mozilla-actions/[email protected]
- name: build
run: cargo build -v
- name: test
Expand All @@ -78,10 +79,7 @@ jobs:
with:
crate: cross
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
key: ${{ matrix.arch }}
uses: mozilla-actions/[email protected]
- name: Start Docker (required for cross-rs)
run: sudo systemctl start docker
- name: Cross-Run Tests using QEMU
Expand All @@ -94,6 +92,8 @@ jobs:
run: sudo apt update && sudo apt install ninja-build meson nasm
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: build
run: cargo build -v --no-default-features --features="avif,avif-native"
env:
Expand All @@ -108,6 +108,8 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- run: cargo clippy --all-features --all-targets -- -D warnings
env:
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: always
Expand All @@ -120,12 +122,8 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: install-deps
run: sudo apt-get -y install clang llvm
- name: Cache Cargo Registry
uses: Swatinem/rust-cache@v2
with:
cache-targets: false
cache-all-crates: true
cache-on-failure: true
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: Install cargo-afl
run: cargo install --locked -f cargo-afl
- name: build
Expand All @@ -144,6 +142,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: Install cargo-fuzz
uses: baptiste0928/cargo-install@v3
with:
Expand All @@ -158,6 +158,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: build
run: |
echo "#![deny(exported_private_dependencies)]" | cat - src/lib.rs > src/lib.rs.0
Expand All @@ -171,6 +173,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: build
run: cargo build -v --benches --features=benchmarks

Expand All @@ -181,6 +185,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Cache Cargo Dependencies
uses: mozilla-actions/[email protected]
- name: Run rustfmt check
run: cargo fmt -- --check

Expand All @@ -195,9 +201,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
uses: mozilla-actions/[email protected]
- uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: default-features

0 comments on commit cceee77

Please sign in to comment.