Merge branch 'add-tests' into 'master'

feat: add slither and unit test run

See merge request cicnet/eth-erc20!4
This commit is contained in:
Blair Vanderlugt 2021-11-24 21:03:14 +00:00
commit c236a9ea78
3 changed files with 33 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ dist/
build/
gmon.out
*.egg-info
.venv/

26
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,26 @@
stages:
- test
- slither-analyzer
test:
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-py-alpine:latest
cache:
- key:
files:
- requirements.txt
- test_requirements.txt
paths:
- /root/.cache/pip
script:
- cd python
- pip install --extra-index-url https://pip.grassrootseconomics.net:8433 -r test_requirements.txt
- pip install --extra-index-url https://pip.grassrootseconomics.net:8433 -r test_requirements.txt
- bash run_tests.sh
slither-analize:
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-py-alpine:latest
script:
- pip install slither-analyzer
- slither solidity/

View File

@ -5,7 +5,8 @@ FROM python:3.8.6-alpine
COPY --from=0 /usr/bin/solc /usr/bin/solc
RUN apk update &&\
apk add gcc bash musl-dev
apk add gcc bash musl-dev libffi-dev openssl-dev autoconf automake build-base \
libtool pkgconfig python3-dev cargo
WORKDIR /usr/src
@ -14,6 +15,8 @@ WORKDIR /usr/src
COPY ./solidity/ /usr/src/giftable_erc20_token/solidity/
COPY ./python/ /usr/src/giftable_erc20_token/python/
RUN chmod +x ./python/run_tests.sh
RUN cd giftable_erc20_token/solidity && \
solc GiftableToken.sol --abi | awk 'NR>3' > GiftableToken.abi.json
@ -24,5 +27,7 @@ RUN cd giftable_erc20_token/solidity && \
RUN cd giftable_erc20_token/python && \
pip install --extra-index-url https://pip.grassrootseconomics.net:8433 .
RUN pip install slither-analyzer
# To deploy:
# giftable-token-deploy --contracts-dir giftable_erc20_token/solidity/ <amount>