eth-erc20

ERC20 interface and example giftable token contract
Info | Log | Files | Refs | LICENSE

.gitlab-ci.yml (2010B)


      1 stages:
      2   - test
      3   - run-coverage
      4   - slither-analyzer
      5 
      6 
      7 variables:
      8   PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
      9 
     10 cache:
     11   paths:
     12     - .cache/pip
     13     - venv/
     14 
     15 before_script:
     16   - python -V               # Print out python version for debugging
     17   - pip install virtualenv
     18   - virtualenv venv
     19   - source venv/bin/activate
     20 
     21 test:
     22   image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
     23   script: 
     24       # build abi
     25       - 'echo "Running Solc Version: $(solc --version)"'
     26       - cd solidity 
     27       - solc --evm-version=byzantium GiftableToken.sol --abi | awk 'NR>3' > GiftableToken.abi.json
     28       # build bin
     29       - solc GiftableToken.sol --bin | awk 'NR>3' > GiftableToken.bin && 
     30         truncate -s "$((`stat -t -c "%s" GiftableToken.bin`-1))" GiftableToken.bin
     31       # install test dependencies
     32       - cd ../python 
     33       - export PYTHONPATH=.
     34       - pip install --extra-index-url https://pip.grassrootseconomics.net 
     35         --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple 
     36         -r requirements.txt -r test_requirements.txt 
     37       # run tests
     38       - bash run_tests.sh
     39 
     40 run-coverage:
     41   stage: test
     42   image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
     43   script:
     44     - cd python 
     45     - export PYTHONPATH=.
     46     - pip install --extra-index-url https://pip.grassrootseconomics.net 
     47         --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple 
     48         -r requirements.txt -r test_requirements.txt 
     49     -  pip install pytest pytest-cov
     50     - coverage run -m pytest
     51     - coverage html
     52     - coverage report --fail-under=90
     53     
     54   coverage: '/^TOTAL.+?(\d+\%)$/'
     55   artifacts:
     56     reports:
     57       cobertura: python/htmlcov/index.html
     58 
     59 slither-analyzer:
     60   image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest
     61   allow_failure: true
     62   script: 
     63     - cd solidity
     64     - slither GiftableToken.sol
     65     - slither GiftableToken.sol --print human-summary
     66 
     67