Skip to content

Zy0n/7702 base main #338

Zy0n/7702 base main

Zy0n/7702 base main #338

name: Integration Tests (V3)
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
integration-tests:
if: false # Disable this job while V3 isn't ready
name: 🧪 Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '22'
- name: Checkout engine repo
uses: actions/checkout@v3
with:
path: engine
- name: Checkout contract repo
uses: actions/checkout@v3
with:
repository: Railgun-Privacy/contract
path: contract
- name: Enable Corepack
run: corepack enable
- name: Yarn in engine
working-directory: ./engine
run: yarn install --frozen-lockfile
- name: Yarn in contract
working-directory: ./contract
run: yarn install --frozen-lockfile
- name: Build contract
working-directory: ./contract
run: ./node_modules/.bin/hardhat compile
- name: Start Hardhat node (background)
working-directory: ./contract
run: |
npx hardhat node > "$GITHUB_WORKSPACE/hardhat.log" 2>&1 &
echo $! > "$GITHUB_WORKSPACE/hardhat.pid"
for i in {1..120}; do
if curl -s -o /dev/null -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
http://localhost:8545; then
echo "Hardhat node ready"
exit 0
fi
sleep 1
done
echo "Hardhat node did not become ready in 120s"
cat "$GITHUB_WORKSPACE/hardhat.log"
exit 1
- name: Deploy test contracts
working-directory: ./contract
run: npx hardhat deploy:test --network localhost
- name: Run engine tests
working-directory: ./engine
run: yarn test-hardhat
- name: Stop Hardhat node
if: always()
run: |
if [ -f "$GITHUB_WORKSPACE/hardhat.pid" ]; then
kill "$(cat "$GITHUB_WORKSPACE/hardhat.pid")" 2>/dev/null || true
fi