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 : |
0 commit comments