Skip to content

Commit 02cb4b3

Browse files
authored
Merge pull request #835 from kyonRay/dev
<sync>(code): sync code from master.
2 parents c01efd5 + 449ba90 commit 02cb4b3

File tree

589 files changed

+16426
-4653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

589 files changed

+16426
-4653
lines changed

.ci/ci_check.sh

Lines changed: 105 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ check_basic()
1313
bash gradlew build --info
1414
}
1515

16+
download_tassl()
17+
{
18+
local OPENSSL_CMD=${HOME}/.fisco/tassl-1.1.1b
19+
if [ -f "${OPENSSL_CMD}" ];then
20+
return
21+
fi
22+
local package_name="tassl-1.1.1b-linux-x86_64"
23+
if [ "$(uname)" == "Darwin" ];then
24+
package_name="tassl-1.1.1b-macOS-x86_64"
25+
fi
26+
curl -LO "https://github.com/FISCO-BCOS/LargeFiles/raw/master/tools/${package_name}.tar.gz" && tar -zxvf "${package_name}.tar.gz" && mv "${package_name}" tassl-1.1.1b && mkdir -p ~/.fisco && mv tassl-1.1.1b ~/.fisco/
27+
}
28+
1629
download_build_chain()
1730
{
1831
local tag="${1}"
@@ -23,6 +36,17 @@ download_build_chain()
2336
curl -LO "https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/${tag}/build_chain.sh" && chmod u+x build_chain.sh
2437
}
2538

39+
download_binary()
40+
{
41+
local tag="${1}"
42+
LOG_INFO "--- current tag: $tag"
43+
local package_name="fisco-bcos-linux-x86_64.tar.gz"
44+
if [ "$(uname)" == "Darwin" ];then
45+
package_name="fisco-bcos-macOS-x86_64.tar.gz"
46+
fi
47+
curl -LO "https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/${tag}/${package_name}" && tar -zxvf "${package_name}"
48+
}
49+
2650
get_sed_cmd()
2751
{
2852
local sed_cmd="sed -i"
@@ -42,84 +66,132 @@ prepare_environment()
4266
cp src/test/resources/clog.ini conf/
4367
cp src/test/resources/config-example.toml src/test/resources/config.toml
4468
cp src/test/resources/log4j2.properties src/integration-test/resources/
45-
cp -r src/test/resources/amop conf/amop
46-
cp -r src/test/resources/amop src/integration-test/resources/amop
4769
rm -rf src/integration-test/resources/abi
4870
rm -rf src/integration-test/resources/bin
4971
cp -r src/test/resources/ecdsa/abi src/integration-test/resources/abi
5072
cp -r src/test/resources/ecdsa/bin src/integration-test/resources/bin
51-
mkdir -p sdk-amop/src/test/resources
52-
cp -r src/test/resources/ sdk-amop/src/test/resources
5373

5474
sed_cmd=$(get_sed_cmd)
55-
5675
local node_type="${1}"
76+
local use_sm="false"
77+
local not_use_sm="true"
5778
if [ "${node_type}" == "sm" ];then
79+
use_sm="true"
80+
not_use_sm="false"
5881
rm -rf src/integration-test/resources/abi
5982
rm -rf src/integration-test/resources/bin
6083
cp -r src/test/resources/gm/abi src/integration-test/resources/abi
6184
cp -r src/test/resources/gm/bin src/integration-test/resources/bin
62-
${sed_cmd} 's/useSMCrypto = "false"/useSMCrypto = "true"/g' src/integration-test/resources/config.toml
6385
fi
86+
use_sm_str="useSMCrypto = \"${use_sm}\""
87+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/config.toml
88+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/amop/config-subscriber-for-test.toml
89+
${sed_cmd} "s/useSMCrypto = \"${not_use_sm}\"/${use_sm_str}/g" ./src/integration-test/resources/amop/config-publisher-for-test.toml
90+
}
91+
92+
prepare_wasm_environment()
93+
{
94+
## prepare resources for integration test
95+
mkdir -p src/integration-wasm-test/resources/
96+
mkdir -p conf
97+
cp -r nodes/127.0.0.1/sdk/* conf
98+
cp src/test/resources/config-example.toml src/integration-wasm-test/resources/config.toml
99+
cp src/test/resources/clog.ini conf/
100+
cp src/test/resources/config-example.toml src/test/resources/config.toml
101+
cp src/test/resources/log4j2.properties src/integration-wasm-test/resources/
64102
}
65103

66104
build_node()
67105
{
68106
local node_type="${1}"
69107
local sed_cmd=$(get_sed_cmd)
70-
if [ "${node_type}" == "sm" ];then
71-
bash build_chain.sh -l 127.0.0.1:4 -s
108+
if [ ! -f "get_account.sh" ];then
109+
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/console/master/tools/get_account.sh
110+
fi
111+
if [ ! -f "get_gm_account.sh" ];then
112+
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/console/master/tools/get_gm_account.sh
113+
fi
114+
if [ "${node_type}" == "wasm" ];then
115+
bash build_chain.sh -l 127.0.0.1:4 -e ./fisco-bcos -w ${2}
72116
else
73-
bash build_chain.sh -l 127.0.0.1:4
117+
bash build_chain.sh -l 127.0.0.1:4 -e ./fisco-bcos ${2}
74118
fi
75119
./nodes/127.0.0.1/fisco-bcos -v
76-
local group_name=`cat nodes/127.0.0.1/node0/config.ini | grep group_id | awk -F '=' '{print $2}'`
77-
if [ ! ${group_name} = 'group0' ] ; then
78-
${sed_cmd} 's/group_id=group/group_id=group0/g' nodes/127.0.0.1/node*/config.ini
79-
fi
80-
cat nodes/127.0.0.1/node0/config.ini | grep group_id
120+
cat nodes/127.0.0.1/node0/config.genesis
81121
bash nodes/127.0.0.1/start_all.sh
82122
}
83123

84124
clean_node()
85125
{
86126
bash nodes/127.0.0.1/stop_all.sh
87127
rm -rf nodes
128+
if [ "${1}" == "true" ]; then
129+
rm -rf ./fisco-bcos*
130+
fi
88131
}
89132

90133
# check integration-test for non-gm node
91134
check_standard_node()
92135
{
93-
build_node
94-
prepare_environment
136+
rm -rf build dist
137+
build_node "normal" "${3}"
138+
prepare_environment "${2}"
95139
## run integration test
96140
bash gradlew clean integrationTest --info
97141
## clean
98-
clean_node
142+
clean_node "${1}"
99143
}
100144

101-
check_sm_node()
145+
check_wasm_node()
102146
{
103-
build_node "sm"
104-
prepare_environment "sm"
147+
rm -rf build dist
148+
build_node "wasm" "${3}"
149+
prepare_wasm_environment
105150
## run integration test
106-
bash gradlew clean integrationTest --info
151+
bash gradlew clean integrationWasmTest --info
107152
## clean
108-
clean_node
153+
clean_node "${1}"
109154
}
155+
LOG_INFO "------ check java version ---------"
156+
java -version
110157

111158
pwd
112159
ls -la
113160
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
114-
LOG_INFO "------ download_build_chain---------"
115-
# set tag v3.0.0-rc1, update when new rc, remove when release final
116-
#download_build_chain "v3.0.0-rc1"
161+
download_tassl
162+
LOG_INFO "------ download_binary: v3.0.0---------"
163+
download_build_chain "v3.0.0"
164+
download_binary "v3.0.0"
165+
LOG_INFO "------ check_standard_node---------"
166+
check_standard_node
167+
rm -rf ./bin
168+
169+
LOG_INFO "------ download_binary: v3.1.0---------"
170+
download_build_chain "v3.1.0"
171+
download_binary "v3.1.0"
172+
LOG_INFO "------ check_standard_node---------"
173+
check_standard_node
174+
rm -rf ./bin
175+
176+
LOG_INFO "------ download_binary: v3.2.0---------"
177+
download_build_chain "v3.2.0"
178+
download_binary "v3.2.0"
179+
LOG_INFO "------ check_standard_node---------"
180+
check_standard_node "true" "sm" "-s -A"
181+
rm -rf ./bin
182+
183+
LOG_INFO "------ download_build_chain: v3.3.0---------"
184+
download_binary "v3.3.0"
185+
download_build_chain "v3.3.0"
186+
LOG_INFO "------ check_standard_node---------"
187+
check_standard_node "true" "sm" "-s"
188+
rm -rf ./bin
189+
190+
LOG_INFO "------ download_build_chain: v3.4.0---------"
191+
download_binary "v3.4.0"
192+
download_build_chain "v3.4.0"
193+
LOG_INFO "------ check_wasm_node---------"
194+
check_wasm_node "false"
117195
LOG_INFO "------ check_standard_node---------"
118-
#check_standard_node
119-
LOG_INFO "------ check_sm_node---------"
120-
#check_sm_node
121-
LOG_INFO "------ check_basic---------"
122-
check_basic
123-
#LOG_INFO "------ check_log---------"
124-
#cat log/* |grep -i error
125-
#cat log/* |grep -i warn
196+
check_standard_node "true" "sm" "-s"
197+
rm -rf ./bin

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- run:
1111
name: Setup dependencies
1212
command: |
13-
yum install -y epel-release centos-release-scl which
13+
yum install -y epel-release centos-release-scl which wget
1414
yum install -y git openssl-devel openssl java java-devel
1515
- checkout
1616
- run:

.codecov.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
codecov:
2-
branch: *
2+
branch: "*"
33
coverage:
44
ignore:
55
- "src/integration-test/**/*"
6+
- "src/integration-wasm-test/**/*"
67
status:
78
project:
89
default:
9-
target: 30%
10-
threshold: null
10+
target: "40%"
11+
threshold: "1%"
1112
if_not_found: success
1213
patch:
1314
default:

.github/workflows/codeql.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master", dev-*, master*, release-* ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master", dev-*, master*, release-* ]
20+
paths-ignore:
21+
- src/test**
22+
schedule:
23+
- cron: '30 23 * * 2'
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: [ 'java' ]
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
queries: +security-and-quality
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v2
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64+
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67+
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2
74+
with:
75+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)