Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
merge to master

See merge request in3/c/in3-core!120
  • Loading branch information
simon-jentzsch committed Feb 6, 2020
2 parents b17a567 + ac17f21 commit bc0b7d8
Show file tree
Hide file tree
Showing 20 changed files with 539 additions and 188 deletions.
35 changes: 35 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
version: "2"
plugins:
csslint:
enabled: true
coffeelint:
enabled: true
duplication:
enabled: true
config:
languages:
- java
- javascript
- python
- c
eslint:
enabled: true
fixme:
enabled: true
exclude_patterns:
- config/
- db/
- dist/
- features/
- "**/node_modules/"
- script/
- "**/spec/"
- "**/test/"
- "**/tests/"
- Tests/
- "**/vendor/"
- "**/*_test.go"
- "**/*.d.ts"
- "**/*.min.js"
- "**/*.min.css"
83 changes: 71 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ stages:
- build
- bindings
- test
- analysis
- deploy
- release

Expand Down Expand Up @@ -161,7 +162,7 @@ java:
# ##### test ######

coverage:
stage: test
stage: analysis
image: silkeh/clang:dev
tags:
- short-jobs
Expand All @@ -173,8 +174,8 @@ coverage:
paths:
- cov_build/ccov/all-merged

analyse:
stage: test
clangcheck:
stage: analysis
image: docker.slock.it/build-images/cmake:clang9
allow_failure: false
tags:
Expand All @@ -189,7 +190,7 @@ analyse:
- report

cppcheck:
stage: test
stage: analysis
image: docker.slock.it/build-images/cmake:gcc-x86-static-analysis
allow_failure: true
tags:
Expand All @@ -201,6 +202,22 @@ cppcheck:
- cd ..
- cppcheck --project=_build/compile_commands.json -i/builds/in3/c/in3-core/test/unity -i/builds/in3/c/in3-core/src/third-party

valgrind:
stage: analysis
image: docker.slock.it/build-images/cmake:valgrind
# allow_failure: true
tags:
- short-jobs
variables:
VALGRIND_OPTS: "-q --leak-check=full --show-leak-kinds=definite --suppressions=suppress.valgrind"
script:
- mkdir _build
- cd _build
- cmake -DCMAKE_BUILD_TYPE=Release -DTEST=true -DDEBUG=false ..
- make
- printf "{\n ignore_libcrypto_conditional_jump_errors\n Memcheck:Leak\n ...\n obj:*/libcrypto.so.*\n}\n" > suppress.valgrind
- for f in test/test*; do valgrind $VALGRIND_OPTS $(pwd)/$f || echo "Failed but ignored for now"; done

test_c:
image: docker.slock.it/build-images/cmake:gcc8
stage: test
Expand Down Expand Up @@ -330,9 +347,10 @@ java_macos:
tags:
- mac-mini-runner

##### deploy #####
##### local_docker_deploy_and_vulnerability_analysis #####

docker:
stage: deploy
stage: bindings
tags:
- short-jobs
services:
Expand All @@ -345,6 +363,49 @@ docker:
- docker push $RELEASE_IMAGE_TAG
- docker push $COMMIT_IMAGE_TAG

##### analyse #####

#include:
# - template: Code-Quality.gitlab-ci.yml

#code_quality:
# stage: analysis
# tags:
# - short-jobs
# artifacts:
# paths: [gl-code-quality-report.json]
# variables:
# CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:latest"
# REPORT_STDOUT: STDOUT

cpd:
stage: analysis
image: rawdee/pmd
tags:
- short-jobs
script:
- cpd --minimum-tokens 180 --language cpp --exclude src/third-party --files src
- cpd --minimum-tokens 150 --language java --files src/bindings/java
- cpd --minimum-tokens 150 --language python --files src/bindings/python

vulnerabilities:
stage: analysis
tags:
- short-jobs
dependencies:
- docker
image: docker.slock.it/build-images/vulnerability-testing-tools
script:
- export TRIVY_AUTH_URL=$CI_REGISTRY
- export TRIVY_USERNAME=gitlab-ci-token
- export TRIVY_PASSWORD=$CI_JOB_TOKEN
- trivy -f json -o vulnerability_analysis.json --exit-code 1 $COMMIT_IMAGE_TAG
artifacts:
paths:
- vulnerability_analysis.json

##### deploy #####

dockerhub-deploy:
stage: deploy
only:
Expand Down Expand Up @@ -652,7 +713,6 @@ release_win:
paths:
- in3-win


release_maven:
stage: deploy
image: docker.slock.it/build-images/maven-deployment-image:latest
Expand Down Expand Up @@ -694,7 +754,6 @@ release_pip:
paths:
- in3-pip


pages:
stage: deploy
only:
Expand All @@ -706,7 +765,8 @@ pages:
- arm7
- readthedocs
- coverage
- analyse
- clangcheck
- vulnerabilities
script:
- mkdir -p public/lib
- tar -zcvf libFiles_$CI_COMMIT_SHORT_SHA.tar.gz arm7_build/lib
Expand All @@ -715,7 +775,8 @@ pages:
- cp -r cov_build/ccov/all-merged public/coverage
- cp -r report/* public/code_analysis
- cp -r doc/build public/rtd
- echo "<html><body><h1>Incubed report for last build</h1><ul><li><a href='rtd/html/index.html'>Read the docs(html)</a></li><li><a href='rtd/latex/Incubed.pdf'>Read the docs(pdf)</a></li><li><a href='code_analysis/index.html'>Code Analysis</a></li><li><a href='coverage/index.html'>Code Coverage</a></li></ul></body></html>" > public/index.html
- cp -r vulnerability_analysis.json public/vulnerability_analysis.json
- echo "<html><body><h1>Incubed report for last build</h1><ul><li><a href='rtd/html/index.html'>Read the docs(html)</a></li><li><a href='rtd/latex/Incubed.pdf'>Read the docs(pdf)</a></li><li><a href='code_analysis/index.html'>Code Analysis</a></li><li><a href='vulnerability_analysis.json'>Vulnerability Analysis</a></li><li><a href='coverage/index.html'>Code Coverage</a></li></ul></body></html>" > public/index.html
artifacts:
paths:
- public
Expand Down Expand Up @@ -888,5 +949,3 @@ github_body_release:
- cat in3-arm7/arm7_release_ipfs_hash.txt >> release_ipfs_hash.txt
- cat in3-win/win_release_ipfs_hash.txt >> release_ipfs_hash.txt
- ghr -u slockIt -r in3-c -b "$(cat release_ipfs_hash.txt)" $CI_COMMIT_TAG release_ipfs_hash.txt


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) {

in3_register_curl(); // use curl as the default for sending out requests

in3_t* in3 = in3_new(); // create new incubed client
in3_t* in3 = in3_for_chain(ETH_CHAIN_ID_MAINNET); // create new incubed client

char *result, *error; // prepare 2 pointers for the result.

Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The following versions are maintained and supported
| ------- | ------------------ |
| 2.0.x-RC| :x: |
| 2.1.x | :white_check_mark: |
| 2.2.x | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
Loading

0 comments on commit bc0b7d8

Please sign in to comment.