Skip to content

Commit 8515d2d

Browse files
committed
ci: add caching for built dependencies
Cache ports/ and tmp/ directories to speed up builds. The cache key is based on platform and recipe file hashes, so changes to configuration or build recipes will invalidate the cache.
1 parent 11d895c commit 8515d2d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/gem-build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ jobs:
5454
steps:
5555
- uses: actions/checkout@v6
5656

57+
- name: Cache built dependencies
58+
uses: actions/cache@v4
59+
with:
60+
path: |
61+
ports
62+
tmp
63+
lib/ffi-libarchive-binary/libarchive.*
64+
key: deps-${{ matrix.platform }}-${{ hashFiles('ext/configuration.yml', 'lib/ffi-libarchive-binary/*_recipe.rb', 'lib/ffi-libarchive-binary/base_recipe.rb') }}
65+
restore-keys: |
66+
deps-${{ matrix.platform }}-
67+
5768
- uses: ruby/setup-ruby@v1
5869
with:
5970
ruby-version: ${{ matrix.ruby }}

0 commit comments

Comments
 (0)