Contract state verification update #1483
Workflow file for this run
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
name: Protocol | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- "protocol/**" | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- run: yarn add prettier | |
- run: yarn add prettier-plugin-solidity | |
- run: shopt -s globstar; yarn prettier --write --config .prettierrc --plugin=prettier-plugin-solidity protocol/**/*.sol || true | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: prettier auto formatting changes | |
branch: ${{ github.head_ref }} | |
- name: check format | |
run: shopt -s globstar; yarn prettier --check --config .prettierrc --plugin=prettier-plugin-solidity protocol/**/*.sol | |
test: | |
needs: format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Protocol Tests | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Cache Node Modules | |
id: node-modules-cache | |
uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install Dependencies | |
if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
- run: yarn generate | |
working-directory: protocol | |
- name: Clear cache and reinstall on generate failure | |
if: steps.generate-with-cache.outcome == 'failure' && steps.node-modules-cache.outputs.cache-hit == 'true' | |
run: | | |
rm -rf **/node_modules | |
yarn install --no-immutable | |
- name: Generate (after potential cache clear) | |
if: steps.generate-with-cache.outcome == 'failure' | |
run: yarn generate | |
working-directory: protocol | |
- name: Run tests | |
run: yarn test | |
env: | |
FORKING_RPC: ${{ secrets.ANVIL_FORK_URL }} | |
working-directory: protocol |