Skip to content

Commit

Permalink
added build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 9, 2023
1 parent 366ac20 commit 7b3a210
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cache_foundry_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:
inputs:
package:
required: true
type: string

env:
# Setting an environment variable with the value of a configuration variable
package_folder: packages/${{ inputs.package }}
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Cache build
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
env:
cache-name: cache-build-${{ inputs.package }}
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/${{ env.package_folder }}/cache
~/${{ env.package_folder }}/out
key: ${{ inputs.package }}-${{ hashFiles(format('{0}/src/**/*.sol', env.package_folder)) }}-${{ hashFiles(format('{0}/test/**/*.sol', env.package_folder)) }}-${{ hashFiles(format('{0}/script/**/*.sol', env.package_folder)) }}
5 changes: 5 additions & 0 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Cache 1155 build
uses: ./.github/workflows/cache_foundry_build.yml
with:
package: "1155-contracts"

- name: Build contracts
run: |
npx turbo run build:contracts
Expand Down

0 comments on commit 7b3a210

Please sign in to comment.