Skip to content

Commit b3dff81

Browse files
authored
Merge pull request #148 from axieinfinity/implement-feature/rework/update-ci
feat(rework): implement `update-ci`
2 parents db28939 + e66f486 commit b3dff81

File tree

4 files changed

+66
-21
lines changed

4 files changed

+66
-21
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: test
33
on:
44
push:
55
branches:
6-
- mainnet
7-
- testnet
86
- 'feature/*'
97
- 'features/*'
8+
- 'implement-feature/**'
9+
- 'implement-feature/**/**'
1010
pull_request:
1111
branches:
1212
- mainnet
@@ -32,12 +32,48 @@ jobs:
3232
- name: Install Foundry
3333
uses: foundry-rs/foundry-toolchain@v1
3434
with:
35-
version: nightly
35+
version: nightly-de33b6af53005037b463318d2628b5cfcaf39916 # Latest stable version
36+
37+
- name: Set up Rust
38+
uses: actions-rs/toolchain@v1
39+
with:
40+
toolchain: stable
41+
profile: minimal
42+
override: true
43+
44+
- name: Cache Cargo registry
45+
uses: actions/cache@v3
46+
with:
47+
path: ~/.cargo/registry
48+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-cargo-registry-
51+
52+
- name: Cache Cargo index
53+
uses: actions/cache@v3
54+
with:
55+
path: ~/.cargo/git
56+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
57+
restore-keys: |
58+
${{ runner.os }}-cargo-index-
59+
60+
- name: Cache Cargo build
61+
uses: actions/cache@v3
62+
with:
63+
path: target
64+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
65+
restore-keys: |
66+
${{ runner.os }}-cargo-build-
67+
68+
- name: Install soldeer
69+
run: cargo install soldeer
70+
- name: Update package
71+
run: soldeer update
3672

3773
- name: Run Forge build
3874
run: |
3975
forge --version
40-
forge build --sizes
76+
forge build
4177
id: build
4278

4379
- name: Run Forge tests

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ronin-mainnet = "https://api-partner.roninchain.com/rpc"
2424
ronin-testnet = "https://saigon-archive.roninchain.com/rpc"
2525
localhost = "http://localhost:8545"
2626

27-
[profile.dependencies]
27+
[dependencies]
2828
forge-std = { version = "1.8.2" }
2929
solady = { version = "0.0.206" }
3030
"@openzeppelin-contracts" = { version = "4.9.3" }

run.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,19 @@ if [[ ! $extra_argument == *"sender"* ]] && [[ ! $extra_argument == *"trezor"* ]
167167
# Check if the .env file exists
168168
if [ -f .env ]; then
169169
source .env
170-
# Check if op:// is present in .env file
171-
if grep -q "op://" .env; then
172-
echo "\033[32mFound 'op://' in .env file\033[0m"
170+
# Convert network name to uppercase
171+
account_label=$(echo $network_name | tr '[:lower:]' '[:upper:]')
172+
# Replace "-" with "_"
173+
account_label=$(echo $account_label | tr '-' '_')
174+
# Add "_PK" prefix
175+
account_label="${account_label}_PK"
176+
177+
# Check if the private key is stored in the .env file
178+
if [[ $(eval "echo \$$account_label") == *"op://"* ]]; then
179+
echo "\033[32mFound 'op://' in ${account_label}\033[0m"
173180
op_command="op run --env-file="./.env" --"
181+
elif [[ $(eval "echo \$$account_label") == *""* ]]; then
182+
echo "\033[33mWARNING: Not found private key in ${account_label}\033[0m"
174183
fi
175184
else
176185
echo "\033[33mWARNING: .env file not found\033[0m"
@@ -194,7 +203,7 @@ if [ $? -eq 0 ]; then
194203
while IFS=',' read -r deployed; do
195204
yarn hardhat sourcify --endpoint https://sourcify.roninchain.com/server --network ${network_name} --contract-name $deployed
196205
done <./logs/deployed-contracts
197-
206+
198207
# Remove the deployed-contracts file
199208
rm ./logs/deployed-contracts
200209
# Restore the .env content

soldeer.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11

2-
[[dependencies]]
3-
name = "forge-std"
4-
version = "1.8.2"
5-
source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_8_2_19-05-2024_18:52:07_forge-std-1.8.2.zip"
6-
checksum = "88a37e1d79f60b8aad08c7bd50a7a5ef973fc172b1495028d0725a17f5a4976c"
7-
8-
[[dependencies]]
9-
name = "solady"
10-
version = "0.0.206"
11-
source = "https://soldeer-revisions.s3.amazonaws.com/solady/0_0_206_06-06-2024_05:38:51_solady.zip"
12-
checksum = "acba3f4e69840ebad8c7fcf01edbf66405015418de6fea119ee46944b9294d6d"
13-
142
[[dependencies]]
153
name = "@openzeppelin-contracts"
164
version = "4.9.3"
@@ -22,3 +10,15 @@ name = "contract-libs"
2210
version = "0.1.1"
2311
source = "https://github.com/axieinfinity/contract-libs/archive/refs/tags/release-v0.1.1.zip"
2412
checksum = "4eab7ea5ba459b1564dd52da6413d4da2acd32e523c3fb3eac2b8309a89bf582"
13+
14+
[[dependencies]]
15+
name = "forge-std"
16+
version = "1.8.2"
17+
source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_8_2_19-05-2024_18:52:07_forge-std-1.8.2.zip"
18+
checksum = "88a37e1d79f60b8aad08c7bd50a7a5ef973fc172b1495028d0725a17f5a4976c"
19+
20+
[[dependencies]]
21+
name = "solady"
22+
version = "0.0.206"
23+
source = "https://soldeer-revisions.s3.amazonaws.com/solady/0_0_206_06-06-2024_05:38:51_solady.zip"
24+
checksum = "acba3f4e69840ebad8c7fcf01edbf66405015418de6fea119ee46944b9294d6d"

0 commit comments

Comments
 (0)