-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
67 lines (57 loc) · 1.96 KB
/
.gitlab-ci.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
stages:
- test
- run-coverage
- slither-analyzer
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
before_script:
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
test:
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
script:
# build abi
- 'echo "Running Solc Version: $(solc --version)"'
- cd solidity
- solc --evm-version=byzantium GiftableToken.sol --abi | awk 'NR>3' > GiftableToken.abi.json
# build bin
- solc GiftableToken.sol --bin | awk 'NR>3' > GiftableToken.bin &&
truncate -s "$((`stat -t -c "%s" GiftableToken.bin`-1))" GiftableToken.bin
# install test dependencies
- cd ../python
- export PYTHONPATH=.
- pip install --extra-index-url https://pip.grassrootseconomics.net
--extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple
-r requirements.txt -r test_requirements.txt
# run tests
- bash run_tests.sh
run-coverage:
stage: test
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
script:
- cd python
- export PYTHONPATH=.
- pip install --extra-index-url https://pip.grassrootseconomics.net
--extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple
-r requirements.txt -r test_requirements.txt
- pip install pytest pytest-cov
- coverage run -m pytest
- coverage html
- coverage report --fail-under=90
coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts:
reports:
cobertura: python/htmlcov/index.html
slither-analyzer:
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
allow_failure: true
script:
- cd solidity
- slither GiftableToken.sol
- slither GiftableToken.sol --print human-summary