Skip to content

Commit f0b09b7

Browse files
committed
Upload anvil artifacts for devchain, instead of ganache (#11568)
1 parent c14376f commit f0b09b7

File tree

14 files changed

+292
-106
lines changed

14 files changed

+292
-106
lines changed

.github/workflows/celo-monorepo.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ env:
3030
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"'
3131
# Git Tag for contract release to use
3232
RELEASE_TAG: core-contracts.v14.anvil
33-
# CELO_BLOCKCHAIN_BRANCH_TO_TEST: master
34-
CELO_BLOCKCHAIN_BRANCH_TO_TEST: release/1.8.x
3533

3634
# EXAMPLE on debug ssh step
3735
# - name: Setup tmate session
@@ -184,7 +182,8 @@ jobs:
184182
workflow: protocol-devchain.yml
185183
name: devchain-${{ env.RELEASE_TAG }}
186184
path: packages/protocol/.tmp/devchain
187-
branch: martinvol/WIPCR13makeItMatchTruffle # TODO change this after https://github.com/celo-org/celo-monorepo/pull/11532 ends up in master
185+
# branch: release/core-contracts/14-anvil # TODO change this after CR15 ends up in master
186+
branch: martinvol/donRunTestAnvilCR14
188187
- name: Install Foundry
189188
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773
190189
with:

.github/workflows/protocol-devchain.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
# monthly on 1 at 0:00 UTC
77
- cron: 0 0 1 * *
88
workflow_dispatch:
9-
9+
push: # TODO remove this after CR15 lands on master
10+
branches: ['martinvol/*'] # TODO remove this after CR15 lands on master
1011
permissions:
1112
contents: read
1213

@@ -19,13 +20,7 @@ jobs:
1920
fail-fast: false
2021
matrix:
2122
include:
22-
- tag: core-contracts.v11
23-
node-version: 18
24-
- tag: core-contracts.v12-renamed
25-
node-version: 18
26-
- tag: core-contracts.v13
27-
node-version: 18
28-
- tag: core-contracts.v14
23+
- tag: core-contracts.v14.anvil
2924
node-version: 18
3025
steps:
3126
- uses: actions/checkout@v4
@@ -37,25 +32,29 @@ jobs:
3732
uses: actions/setup-node@v4
3833
with:
3934
node-version: ${{ matrix.node-version }}
40-
- name: Install yarn dependencies
41-
run: git config --global url."https://".insteadOf ssh:// && yarn install
42-
- name: Build packages
43-
run: yarn build --ignore docs --include-dependencies
35+
- name: install foundry
36+
uses: foundry-rs/foundry-toolchain@v1
37+
with:
38+
version: 'v1.0.0'
39+
- name: Install forge dependencies
40+
run: forge install
41+
working-directory: packages/protocol
4442
# Workaround for https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor
4543
# This is needed because some runners messup with permissions of git files and submodules. Particularly problematic for DinD runners (e.g. self-hosted+container arg)
4644
- name: Configure git safe directories
4745
run: git config --global --add safe.directory '*'
4846
- name: Generate devchain of previous release
4947
run: |
50-
mkdir devchain
51-
GRANTS_FILE=scripts/truffle/releaseGoldExampleConfigs.json
52-
yarn --cwd packages/protocol devchain generate-tar devchain/devchain.tar.gz --release_gold_contracts $GRANTS_FILE
53-
mv packages/protocol/build/contracts* devchain/
48+
yarn anvil-devchain:start-L2
49+
mkdir .tmp/devchain
50+
mv .tmp/devchain.json .tmp/devchain
51+
mv .tmp/l2-devchain.json .tmp/devchain
52+
working-directory: packages/protocol
5453
- name: Upload devchain as artifact
5554
uses: actions/upload-artifact@v4
5655
with:
5756
name: devchain-${{ matrix.tag }}
58-
path: devchain
57+
path: packages/protocol/.tmp/devchain
5958
# Max retention time is 90 days for public repos
6059
# https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy
6160
retention-days: 90

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
[submodule "packages/protocol/lib/solidity-bytes-utils-8"]
2121
path = packages/protocol/lib/solidity-bytes-utils-8
2222
url = https://github.com/GNSPS/solidity-bytes-utils
23-
branch = master
23+
branch = master

packages/protocol/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ deployedGrants.json
3737
# Foundry
3838
cache/
3939
out/
40+
out-truffle-compat/
41+
out-truffle-compat-0.8/
4042

4143
wagmi.config.js
4244
wagmi.config.js.map

packages/protocol/foundry.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# docs: https://getfoundry.sh/config/reference/default-config
12
[profile.default]
23
src = 'contracts-0.8'
34
out = 'out'
@@ -15,22 +16,31 @@ no_match_path = "{**/test/BLS12Passthrough.sol,**/test/RandomTest.sol,**/test-so
1516

1617
fs_permissions = [
1718
{ access = "read", path = "./out"},
19+
{ access = "read", path = "./out-truffle-compat"},
20+
{ access = "read", path = "./out-truffle-compat-0.8"},
1821
{ access = "read", path = "./migrations_sol/migrationsConfig.json"},
1922
{ access = "read", path = "./migrations_sol/"},
2023
{ access = "read", path = "./governanceConstitution.json"},
2124
{ access = "read", path = "./artifacts/"},
2225
{ access = "read", path = "./.tmp/selectors" }
2326
]
2427

28+
2529
[profile.devchain] # Special profile for the tests that require an anvil devchain
2630
test = 'test-sol/devchain'
2731
match_path = "**/test-sol/devchain/**"
2832
no_match_path = "{**/test/BLS12Passthrough.sol,**/test/RandomTest.sol}"
2933

34+
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
35+
36+
# from https://github.com/celo-org/celo-monorepo/pull/11488/
37+
3038
# Profile to match Truffle configuration for 0.5.13 contracts
3139
[profile.truffle-compat]
40+
skip=[
41+
"test-sol/**", # skip everything under test-sol
42+
]
3243
src = 'contracts'
33-
skip= [ "test-sol/**" ]
3444
out = 'out-truffle-compat'
3545
libs = ['lib', 'node_modules']
3646
solc_version = '0.5.14'
@@ -42,8 +52,10 @@ via_ir = false
4252

4353
# Profile to match Truffle configuration for 0.8.19 contracts
4454
[profile.truffle-compat8]
55+
skip=[
56+
"test-sol/**", # skip everything under test-sol
57+
]
4558
src = 'contracts-0.8'
46-
skip= [ "test-sol/**" ]
4759
out = 'out-truffle-compat-0.8'
4860
libs = ['lib', 'node_modules']
4961
solc_version = '0.8.19'

0 commit comments

Comments
 (0)