Skip to content

Commit

Permalink
Add caching to build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
erskingardner committed Jan 6, 2025
1 parent 0c8a4de commit 828f0fc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ jobs:
steps:
- uses: actions/checkout@v4

# Add Rust cache
- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-rust-${{ matrix.android && 'android' || 'desktop' }}"

# Add Bun cache
- name: Cache bun dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
# Add Android NDK cache (only for Android builds)
- name: Cache Android NDK
if: matrix.android
uses: actions/cache@v4
with:
path: /usr/local/lib/android/sdk/ndk/25.2.9519653
key: ${{ runner.os }}-ndk-25.2.9519653

- name: Set up JDK 17
if: matrix.android
uses: actions/setup-java@v4
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ jobs:
steps:
- uses: actions/checkout@v4

# Add Rust cache
- uses: Swatinem/rust-cache@v2

# Add Bun cache
- name: Cache bun dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
Expand Down

0 comments on commit 828f0fc

Please sign in to comment.