-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(workflows): forge ci + lint script (#24)
* config(workflows): forge ci + lint script * fix(workflows): foundry ci nightly
- Loading branch information
Showing
4 changed files
with
66 additions
and
25 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,64 @@ | ||
# Run this separately from pre-commit for nice visual coverage. | ||
name: Foundry CI | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
# Add a timestamp to the build | ||
Timestamp: | ||
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main | ||
|
||
foundry-test: | ||
strategy: | ||
fail-fast: true | ||
name: Foundry Unit Test | ||
runs-on: ubuntu-latest | ||
needs: [Timestamp] | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
package_json_file: contracts/package.json | ||
|
||
- name: Run install | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install # will run `yarn install` command | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
# First, install the dependencies | ||
- run: pnpm install | ||
working-directory: contracts | ||
|
||
# Run lint | ||
- name: Check lint | ||
run: pnpm lint-check | ||
working-directory: contracts | ||
|
||
# first, build contracts excluding the tests and scripts. Check contract sizes in this step. | ||
- name: Run Contract Size check | ||
run: | | ||
forge --version | ||
forge build --force --sizes --skip test --skip script | ||
working-directory: contracts | ||
|
||
# This step requires full build to be run first | ||
- name: Upgrade Safety test | ||
run: | | ||
forge clean && forge build --build-info | ||
working-directory: contracts | ||
# npx @openzeppelin/upgrades-core validate out/build-info | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv --gas-limit 800000000000 | ||
id: forge-test | ||
working-directory: contracts |
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