-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (34 loc) · 923 Bytes
/
run-tests.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
40
41
42
name: Run Tests on Pull Request
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
# Install dependencies
- name: Install dependencies
run: npm install
# Compile the smart contracts
- name: Compile contracts
run: npx hardhat compile
# Run the tests
- name: Run tests
run: npx hardhat test
# Cache dependencies (optional)
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-