-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (36 loc) · 1.13 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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