-
Notifications
You must be signed in to change notification settings - Fork 14
84 lines (68 loc) · 2.48 KB
/
truffle.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
# Reference: https://github.com/marketplace/actions/setup-node-js-environment
name: Truffle Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup NodeJS 16
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Show NodeJS version
run: npm --version
- name: Create .env file
run: echo "${{ secrets.DOT_ENV }}" > .env
- name: Install Truffle
run: npm install [email protected] -g # cannot use truffle@latest due to https://github.com/sc-forks/solidity-coverage/issues/696
- name: Install Truffle Dependencies
run: npm install
- name: Run Truffle Test with CI=true for Codechecks
run: CI=true truffle test
- name: Run Codechecks
run: npx codechecks
env:
CC_SECRET: ${{ secrets.CC_SECRET }}
- name: Run Test Coverage
run: truffle run coverage
- name: Generate .coveralls.yml file
run: echo "${{ secrets.DOT_COVERALLS_YML }}" > .coveralls.yml
- name: Send Coverage Info to CoverAlls
run: cat coverage/lcov.info | npx coveralls
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8 # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Show Python version
run: python --version
- name: Clone SmartBugs Repo
run: git clone https://github.com/smartbugs/smartbugs.git
- name: Remove SmartBugs Results and Install SmartBugs Dependencies
run: cd smartbugs;rm -r results;pip install -r requirements.txt
- name: Run SmartBugs Analysis
run: |
solidityFiles=($(ls -I Migrations.sol contracts))
DIR=$(pwd);cd smartbugs
for sol in "${solidityFiles[@]}"
do
echo "Analysing $sol..."
python smartBugs.py --tool all --file $DIR/contracts/$sol
done
- name: Move SmartBugs Results to Parent Directory
run: |
[[ -d results ]] && rm -r results
cd smartbugs
mv results ../
- name: Commit SmartBugs Results
uses: EndBug/add-and-commit@v7
with:
author_name: github-actions
author_email: [email protected]
message: 'chore: added smartbugs results'
add: 'results'