-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
168 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Cache foundry build' | ||
description: 'Caches foundry build by path' | ||
|
||
inputs: | ||
package_folder: # id of input | ||
description: 'contracts package folder' | ||
required: true | ||
foundry_profile: | ||
description: 'foundry profile for caching' | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Cache contracts build | ||
uses: actions/cache@v3 | ||
with: | ||
# npm cache files are stored in out and cache | ||
path: | | ||
${{ inputs.package_folder }}/cache | ||
${{ inputs.package_folder }}/out | ||
# cache key is based on foundry config, contracts source tests, and scripts | ||
key: ${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/test/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/script/**/*.sol', inputs.package_folder)) }} | ||
# the following backups cache keys are searched, in case an exact match is not found | ||
# see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | ||
restore-keys: | | ||
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/test/**/*.sol', inputs.package_folder)) }}- | ||
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}- | ||
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "1155" | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
package_folder: packages/1155-contracts | ||
|
||
test: | ||
needs: build | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
package_folder: packages/1155-contracts | ||
|
||
coverage: | ||
uses: ./.github/workflows/coverage.yml | ||
with: | ||
package: "1155-contracts" | ||
files_to_ignore: '"*DeploymentConfig*" "*Redeem*" "*deployment*" "*packages*"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
package_folder: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install node deps and founry | ||
uses: ./.github/actions/setup_deps | ||
|
||
- name: Cache build | ||
uses: ./.github/actions/cache_foundry_build | ||
with: | ||
package_folder: ${{ inputs.package_folder }} | ||
|
||
- name: Build contracts | ||
run: | | ||
cd ${{ inputs.package_folder}} && forge build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Contracts" | ||
|
||
on: "push" | ||
|
||
jobs: | ||
contracts-1155: | ||
name: 1155 | ||
uses: ./.github/workflows/1155.yml | ||
|
||
contracts-protocol-rewards: | ||
name: Protocol Rewards | ||
uses: ./.github/workflows/protocol-rewards.yml | ||
|
||
contracts-protocol-deployments: | ||
name: Protocol Deployments | ||
uses: ./.github/workflows/protocol-deployments.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "1155" | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
package_folder: packages/protocol-deployments | ||
|
||
test: | ||
needs: build | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
package_folder: packages/protocol-deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Protocol Rewards" | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
package_folder: packages/protocol-rewards | ||
|
||
test: | ||
needs: build | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
package_folder: packages/protocol-rewards | ||
|
||
coverage: | ||
uses: ./.github/workflows/coverage.yml | ||
with: | ||
package: "protocol-rewards" | ||
files_to_ignore: '"*lib*"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
package_folder: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install node deps and founry | ||
uses: ./.github/actions/setup_deps | ||
|
||
- name: Load foundry cache | ||
uses: ./.github/actions/cache_foundry_build | ||
with: | ||
package_folder: ${{ inputs.package_folder }} | ||
|
||
- name: Test | ||
run: | | ||
cd ${{ inputs.package_folder}} && yarn test | ||
env: | ||
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters