Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cooooo966 committed Jun 11, 2024
1 parent 00c2861 commit 27886e5
Show file tree
Hide file tree
Showing 1,322 changed files with 215,905 additions and 2,031 deletions.
169 changes: 169 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
version: 2.1

commands:
install_depencies:
description: Setup Ubuntu dependencies
parameters:
packages:
type: string
default: ""
steps:
- run:
name: Setup dependencies
command: |
apt-get update
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
apt-get install -y cmake g++ git curl build-essential autoconf texinfo cmake flex bison libzstd-dev zlib1g-dev libpython3-dev python-dev << parameters.packages >>
echo 'export CCACHE_DIR=/ccache' >> $BASH_ENV
curl https://sh.rustup.rs -sSf | bash -s -- -y
source $HOME/.cargo/env
compile:
description: Compile
parameters:
options:
type: string
default: ""
compiler:
type: string
default: ""
steps:
- run:
name: Compile
no_output_timeout: 40m
command: |
source $HOME/.cargo/env
mkdir -p build && cd build
<< parameters.compiler >> cmake -DURL_BASE=github.com -DCMAKE_BUILD_TYPE=debug -DHUNTER_JOBS_NUMBER=1 << parameters.options >> ..
make -j2
executors:
ubuntu-bionic:
docker:
- image: ubuntu:18.04
ubuntu-focal:
docker:
- image: ubuntu:20.04

jobs:
build_test:
working_directory: /FISCO-BCOS
executor: ubuntu-focal
steps:
- install_depencies:
packages: "git curl build-essential cmake ccache lcov libzstd-dev libgmp-dev"
- checkout
- restore_cache:
keys:
- deps-cache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum ".circleci/config.yml" }}
- deps-cache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-
- deps-cache-v1-{{ .Environment.CIRCLE_JOB }}-
- compile:
options: "-DTESTS=ON -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
- save_cache:
key: deps-cache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum ".circleci/config.yml" }}
paths:
- deps
- /ccache
- /root/.hunter
- run:
name: Unit test
command: |
cd build
CTEST_OUTPUT_ON_FAILURE=TRUE make test
rm -rf /FISCO-BCOS/deps
- persist_to_workspace:
root: /
paths:
- FISCO-BCOS/build/*
- FISCO-BCOS/test/*
- FISCO-BCOS/tools/*

generate_coverage:
working_directory: /FISCO-BCOS
executor: ubuntu-focal
steps:
- install_depencies:
packages: "lcov"
- attach_workspace:
at: /
- run:
name: Upload Coverage
command: |
bash <(curl -s https://codecov.io/bash) -C $CIRCLE_SHA1 -f "!*/deps/*" > /dev/null
build_test_guomi:
working_directory: /FISCO-BCOS-GM
docker:
- image: centos:7
steps:
- run:
name: Setup dependencies
command: |
yum install -y epel-release centos-release-scl
yum install -y git make gcc gcc-c++ gmp-static glibc-static glibc-devel cmake3 ccache devtoolset-7 libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-7/enable
yum install -y https://repo.ius.io/ius-release-el7.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
echo 'export CCACHE_DIR=/ccache' >> $BASH_ENV
curl https://sh.rustup.rs -sSf | bash -s -- -y
source $HOME/.cargo/env
- checkout
- restore_cache:
keys:
- deps-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum ".circleci/config.yml" }}
- deps-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-
- deps-v1-{{ .Environment.CIRCLE_JOB }}-
- run:
name: Compile
no_output_timeout: 40m
command: |
source /opt/rh/devtoolset-7/enable
source $HOME/.cargo/env
yum list devtoolset-7\*
mkdir -p build && cd build
cmake3 -DURL_BASE=github.com -DCMAKE_BUILD_TYPE=debug -DTESTS=ON -DHUNTER_JOBS_NUMBER=1 ..
make -j2
- save_cache:
key: deps-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum ".circleci/config.yml" }}
paths:
- deps
- /ccache
- /root/.hunter
- run:
name: Unit test
command: |
cd build
make test
- run:
name: Run GM nodes
command: |
cd build
../tools/BcosAirBuilder/build_chain.sh -l "127.0.0.1:4" -e fisco-bcos-air/fisco-bcos -s && cd nodes/127.0.0.1 && bash start_all.sh && sleep 10 && [[ $(ps -ef| grep fisco-bcos |grep -v grep | wc -l) == 4 ]]
workflows:
version: 2
build_and_test:
jobs:
- build_test:
filters:
branches:
only:
- /^pull.*/
tags:
ignore: /.*/
- generate_coverage:
requires:
- build_test
filters:
branches:
only:
- /^pull.*/
tags:
ignore: /.*/
- build_test_guomi:
filters:
branches:
only:
- /^pull.*/
- /^release.*/
tags:
ignore: /.*/
94 changes: 94 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
Language: Cpp
# BasedOnStyle: Chromium
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterCaseLabel: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeColon
ColumnLimit: 100
CommentPragmas: "^ IWYU pragma:"
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
IncludeCategories:
- Regex: '^".*'
Priority: 1
- Regex: "^<boost.*"
Priority: 98
- Regex: '^<.*\.h>'
Priority: 2
- Regex: "^<.*"
Priority: 99
- Regex: ".*"
Priority: 4
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 1
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 50
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
Loading

0 comments on commit 27886e5

Please sign in to comment.