Skip to content

Node.js CI

Node.js CI #251

Workflow file for this run

name: Node.js CI
on:
push:
schedule:
# Runs at 00:00 (midnight) UTC every day
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm ci
- name: Start Hardhat Node
run: |
npx hardhat node > hardhat.log 2>&1 &
echo "Hardhat_PID=$!" > hardhat_pid.env
- name: Run Tests
run: |
RESULT=0
npm test || RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "Tests failed with exit code $RESULT"
echo "Hardhat log:" && cat hardhat.log
exit $RESULT
fi
- name: Stop Hardhat Node
if: always()
run: |
if [ -f hardhat_pid.env ]; then
source hardhat_pid.env
kill $Hardhat_PID || true
fi