-
Notifications
You must be signed in to change notification settings - Fork 87
93 lines (77 loc) · 2.28 KB
/
main.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- name: Linting
run: yarn lint:ci
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- name: Formatting
run: yarn format:ci
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Slither
run: pip3 install slither-analyzer
- name: Running Slither
run: yarn analyze:ci
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- name: Running tests
run: yarn test:ci
env:
ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- name: Running coverage
run: yarn coverage:ci
- name: Coverage created?
id: check_coverage
run: |
if [ -s $GITHUB_WORKSPACE/coverage/lcov.info ] ; then
echo "check_result=true" >> $GITHUB_OUTPUT
echo "lcov.info FILE exists and has a size greater than zero"
else
echo "check_result=false" >> $GITHUB_OUTPUT
echo "lcov.info does not exists or has size zero"
fi
- name: Report coverage
if: steps.check_coverage.outputs.check_result == 'true'
uses: romeovs/[email protected]
with:
lcov-file: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enforce coverage
if: steps.check_coverage.outputs.check_result == 'true'
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: ./coverage/lcov.info
min_coverage: 80
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: "./.github/setup"
- name: Deploy contracts
run: yarn deploy:ci
env:
ETH_NODE_URI_GOERLI: ${{ secrets.ETH_NODE_URI_GOERLI }}
ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}