From ee183e5f6dba45f1fc573de809c78f6d327e03ef Mon Sep 17 00:00:00 2001 From: Yohan9206 Date: Mon, 14 Jul 2025 14:12:19 +0300 Subject: [PATCH] adding hardhat test from the sample porject --- .github/workflows/deploy-devnet.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-devnet.yml b/.github/workflows/deploy-devnet.yml index df51153f7f..7aecdd8b03 100644 --- a/.github/workflows/deploy-devnet.yml +++ b/.github/workflows/deploy-devnet.yml @@ -90,4 +90,31 @@ jobs: - name: Push image to Docker Hub run: | docker push $FINAL_IMAGE:latest - docker push $FINAL_IMAGE:${{ env.COMMIT_SHA }} \ No newline at end of file + 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 \ No newline at end of file