Skip to content

Commit 65db845

Browse files
committed
Fixed test workflow dependency issue
1 parent 5c23646 commit 65db845

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
submodules: recursive
19+
# Ensure we get the full history and all submodule commits
20+
fetch-depth: 0
1921

2022
- name: Install Foundry
2123
uses: foundry-rs/foundry-toolchain@v1
@@ -24,15 +26,42 @@ jobs:
2426
run: |
2527
forge --version
2628
27-
- name: Install dependencies
29+
# Critical: Force update submodules to ensure they're fully initialized
30+
- name: Initialize and update submodules
2831
run: |
29-
forge install
30-
forge remappings > remappings.txt
32+
git submodule update --init --recursive --force
33+
git submodule status
3134
32-
# - name: Run Forge fmt
33-
# run: |
34-
# forge fmt --check
35-
# id: fmt
35+
# Verify the lib directory structure exists
36+
- name: Verify dependencies
37+
run: |
38+
echo "=== Lib directory contents ==="
39+
ls -la lib/ || echo "lib/ directory not found"
40+
echo "=== forge-std contents ==="
41+
ls -la lib/forge-std/ || echo "forge-std not found"
42+
ls -la lib/forge-std/src/ || echo "forge-std/src not found"
43+
echo "=== openzeppelin-contracts contents ==="
44+
ls -la lib/openzeppelin-contracts/ || echo "openzeppelin-contracts not found"
45+
ls -la lib/openzeppelin-contracts/contracts/ || echo "openzeppelin-contracts/contracts not found"
46+
47+
# If submodules are empty, try installing dependencies
48+
- name: Install dependencies if missing
49+
run: |
50+
if [ ! -f "lib/forge-std/src/Test.sol" ]; then
51+
echo "forge-std not found, installing..."
52+
forge install foundry-rs/forge-std
53+
fi
54+
if [ ! -f "lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol" ]; then
55+
echo "openzeppelin-contracts not found, installing..."
56+
forge install OpenZeppelin/openzeppelin-contracts
57+
fi
58+
59+
# Final verification before build
60+
- name: Final dependency check
61+
run: |
62+
echo "=== Final verification ==="
63+
ls -la lib/forge-std/src/Test.sol || echo "Test.sol missing"
64+
ls -la lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol || echo "ERC20.sol missing"
3665
3766
- name: Run Forge build
3867
run: |

foundry.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ out = "out"
44
libs = ["lib"]
55
solc_version = "0.8.22"
66
remappings = [
7-
"@openzeppelin/=lib/openzeppelin-contracts/",
8-
"foundry-huff/=lib/foundry-huff/src/",
9-
"forge-std/=lib/forge-std/src/"
7+
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
8+
"forge-std/=lib/forge-std/src/",
109
]
1110
via_ir = true
1211
optimizer = true

0 commit comments

Comments
 (0)