Skip to content

Commit

Permalink
caching linux dependencies between build checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdenasser committed Nov 8, 2024
1 parent 3389941 commit ac9d600
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 1
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
RUSTC_WRAPPER: sccache
CARGO_BUILD_JOBS: ${{ runtime.numCPU }}

jobs:
build:
Expand All @@ -21,23 +27,19 @@ jobs:
node-version: 'lts/*'
cache: 'npm'

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: cargo

- uses: Swatinem/rust-cache@v2

- name: Cache Linux Dependencies
id: cache-apt
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build-check.yml') }}
path: |
/var/cache/apt
/var/lib/apt/lists
key: ${{ runner.os }}-apt-${{ hashFiles('**/build-check.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install Linux Dependencies
if: steps.cache-apt.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
Expand All @@ -50,6 +52,18 @@ jobs:
libjavascriptcoregtk-4.0-dev \
libsoup-3.0-dev \
libwebkit2gtk-4.1-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: cargo
target: x86_64-unknown-linux-gnu
profile: minimal

- uses: Swatinem/rust-cache@v2
with:
shared-key: "build"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Install Dependencies
run: npm ci
Expand Down

0 comments on commit ac9d600

Please sign in to comment.