Skip to content

Commit

Permalink
Merge pull request #807 from lidofinance/feat/ci-scratcy-deploy
Browse files Browse the repository at this point in the history
Add CI workflow to do local scratch deployment
  • Loading branch information
arwer13 authored Dec 7, 2023
2 parents bfc9fb6 + 2842af4 commit c5a5797
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 263 deletions.
20 changes: 0 additions & 20 deletions .github/deployed-bytecode-consts.js

This file was deleted.

24 changes: 0 additions & 24 deletions .github/prepare-accounts-json.py

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: >
curl -sSL https://install.python-poetry.org | python - &&
poetry install --no-root
- name: Remove foundry.toml
run: rm -f foundry.toml

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/assert-bytecode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ name: Verify deployed contracts' bytecode

on:
pull_request:
branches:
- 'master'
branches: [master]

jobs:
assert-bytecode:
name: Assert deployed contracts bytecode
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -49,6 +48,9 @@ jobs:
- name: Compile contracts
run: yarn compile

- name: Write config for action-verify-bytecode
run: yarn extract-artifacts

- name: Verify bytecode
uses: lidofinance/action-verify-bytecode@master
with:
Expand All @@ -64,5 +66,5 @@ jobs:
cat _actual _expected | sort | uniq -u | tee _diff
[ -s _diff ] && exit 1 || exit 0
env:
IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil
IGNORE_REGEX: test|lib|mock|interface|template|OrderedCallback|Pausable|Versioned|BeaconChainDepositor|PausableUntil|WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy
if: ${{ always() }}
6 changes: 3 additions & 3 deletions .github/workflows/fix-abi-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -57,14 +57,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-abis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/scratch-deploy-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Scratch deploy on local clean anvil

on:
pull_request:
branches: [master, develop]

jobs:
do-scratch-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Start anvil in background
# For the port see port in scripts/scratch/dao-local-deploy.sh in RPC_URL env var
run: anvil -p 8555 --mnemonic "test test test test test test test test test test test junk" &

- name: Setup node.js version
uses: actions/setup-node@v4
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache yarn cache
id: cache-yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-${{ hashFiles('**/yarn.lock') }}

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: node_modules-${{ hashFiles('**/yarn.lock') }}

- name: Install modules
run: yarn
if: |
steps.cache-yarn-cache.outputs.cache-hit != 'true' ||
steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Run local deploy script
run: bash scripts/scratch/dao-local-deploy.sh
7 changes: 4 additions & 3 deletions .github/workflows/storage-layout-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
name: Assert storage layout
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'

- name: Submodules
Expand All @@ -32,3 +32,4 @@ jobs:
mode: check
src-folder: ./contracts
ignore-folders: '{test_helpers,template,mocks}'
ignore-contracts: 'WithdrawalsManagerProxy|WithdrawalsManagerStub|ERC1967Proxy'
6 changes: 3 additions & 3 deletions .github/workflows/storage-layout-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
name: Update storage layout
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'

- name: Install yarn deps
Expand Down
Loading

0 comments on commit c5a5797

Please sign in to comment.