Add PR template #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: [push] | |
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 |