-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (64 loc) · 1.93 KB
/
ci.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI
on:
workflow_dispatch:
push:
branches:
- "**"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["20.15.x"]
python-version: ["3.12"]
solidity-version: ["0.8.7"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
cache: pip
- name: Install node dependencies
run: npm ci
- name: Install python dependencies
run: |
pip install -U pip setuptools
pip install -q -r requirements.txt
- name: Configure solidity compiler
run: |
solc-select install ${{ matrix.solidity-version }}
solc-select use ${{ matrix.solidity-version }}
- name: Clean artifacts
run: npm run clean
- name: Compile contracts
run: npm run compile
- name: Lint code
run: npm run lint
- name: Check contracts with linter
run: npm run check
- name: Analyze contracts with static analyzer
run: npm run analyze:ci
- name: Run unit tests
run: npm run test:ci
- name: Deploy contracts into hardhat network
run: make hardhat
- name: Save contract artifacts
uses: actions/upload-artifact@v4
with:
name: contracts
path: |
artifacts/contracts/
!artifacts/contracts/**/*.dbg.json
!artifacts/contracts/interfaces/
!artifacts/contracts/libraries/
!artifacts/contracts/mocks/
!artifacts/contracts/state-transfer/
retention-days: 30