adding hardhat test from the sample porject

This commit is contained in:
Yohan9206 2025-07-14 14:12:19 +03:00
parent 0dbbaa0f46
commit ee183e5f6d

View file

@ -90,4 +90,31 @@ jobs:
- name: Push image to Docker Hub
run: |
docker push $FINAL_IMAGE:latest
docker push $FINAL_IMAGE:${{ env.COMMIT_SHA }}
docker push $FINAL_IMAGE:${{ env.COMMIT_SHA }}
- name: Run container with predeployed contracts
run: |
docker run -d \
--name test-node \
-p 8545:8545 \
$FINAL_IMAGE:latest \
--dev --http --http.api eth,net,web3,personal
sleep 20
# - name: Wait for RPC to be ready
# run: |
# echo "Waiting for devnet to be ready..."
# for i in {1..20}; do
# if curl -s http://localhost:8545 > /dev/null; then
# echo "RPC is ready."
# break
# fi
# sleep 2
# done
- name: Run Hardhat tests
working-directory: ./hardhat
run: npx hardhat test --network localhost
- name: Stop and remove test container
run: docker rm -f test-node