-
Notifications
You must be signed in to change notification settings - Fork 16
/
tox.ini
138 lines (115 loc) · 2.96 KB
/
tox.ini
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
[tox]
setenv = PATH = {toxinidir}/node_modules/.bin:${PATH}
envlist =
truffle-build
truffle-test
solhint
coverage
sphinx
xbr-js
[testenv]
description =
Common environment.
skip_install = True
whitelist_externals =
sh
cp
mkdir
echo
ls
rm
which
npm
make
gzip
python
truffle
solhint
solidity-coverage
sphinx-build
browserify
google-closure-compiler
setenv =
XBR_BUILD_ID = {env:XBR_BUILD_ID:00000}
commands =
echo "Building with XBR_BUILD_ID={env:XBR_BUILD_ID}"
[testenv:truffle-build]
description =
Compile smart contracts using Truffle.
skip_install = True
passenv =
HOME
XBR_BUILD_ID
XBR_HDWALLET_SEED
commands =
# install deps
npm install --only=dev
# now compile Solidity sources
{toxinidir}/node_modules/.bin/truffle compile --all
# check built ABI files in build/contracts for size restrictions on Ethereum mainnet
python ./check-abi-files.py
[testenv:truffle-test]
description =
Test smart contracts using Truffle (requires ganache-cli running).
skip_install = True
passenv =
HOME
XBR_BUILD_ID
XBR_HDWALLET_SEED
commands =
# install deps
npm install --only=dev
# now compile Solidity sources, deploy and test
sh -c 'XBR_HDWALLET_SEED="{env:XBR_HDWALLET_SEED}" {toxinidir}/node_modules/.bin/truffle test --network ganache'
# https://github.com/protofire/solhint
[testenv:solhint]
description =
Linting smart contracts using Solhint.
skip_install = True
passenv =
HOME
XBR_BUILD_ID
XBR_HDWALLET_SEED
commands =
# install deps
npm install --only=dev
# now lint Solidity sources
{toxinidir}/node_modules/solhint/solhint.js -c {toxinidir}/.solhint.json "contracts/**/*.sol"
[testenv:coverage]
description =
Test and generate test coverage report.
skip_install = True
passenv =
HOME
XBR_BUILD_ID
XBR_HDWALLET_SEED
commands =
# install deps
npm install --only=dev
{toxinidir}/node_modules/.bin/truffle run coverage
[testenv:sphinx]
description =
Generate docs using Sphinx.
skip_install = True
passenv =
HOME
XBR_BUILD_ID
XBR_HDWALLET_SEED
commands =
# install deps
npm install --only=dev
# now compile Solidity sources
{toxinidir}/node_modules/.bin/truffle compile --all
# install Sphinx doc builder
pip install -r{toxinidir}/requirements-dev.txt
# build optimized SVG image files using Scour
make images
# run checks with all warnings fatal
# https://github.com/cag/sphinxcontrib-soliditydomain/issues/3
# sh -c 'cd docs && sphinx-build -nWT -b dummy . ./_build'
sh -c 'cd docs && sphinx-build -nT -b dummy . ./_build'
# run spell checker
# sh -c 'cd docs && sphinx-build -W -b spelling -d ./_build/doctrees . ./_build/spelling'
sh -c 'cd docs && sphinx-build -b spelling -d ./_build/doctrees . ./_build/spelling'
# generate HTML output
sh -c 'cd docs && sphinx-build -b html . ./_build'