-
Notifications
You must be signed in to change notification settings - Fork 40
66 lines (60 loc) · 2.32 KB
/
test_smartcontract.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
##############################################################################################
# Copyright Accenture. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##############################################################################################
name: Test Smartcontracts
on:
pull_request:
jobs:
validate_fabric:
if: contains(github.event.pull_request.title, 'Fabric') || contains(github.event.pull_request.title, 'fabric')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
export GOROOT=/usr/local/go
export GOPATH=/opt/gopath
mkdir -p $GOPATH/bin
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
curl https://raw.githubusercontent.com/hyperledger/bevel/main/platforms/hyperledger-fabric/scripts/install.sh | sh
- name: Test Stage all chaincodes.
run: |
# export the bin path
export PATH=~/bin:$PATH
export GOROOT=/usr/local/go
export GOPATH=/opt/gopath
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
mkdir -p $GOPATH/src/github.com
ln -s $(pwd)/examples/supplychain-app/fabric/chaincode_rest_server/chaincode $GOPATH/src/github.com
cd $GOPATH/src/github.com/chaincode/supplychain
dep ensure
go test -v
##########################################################################
validate_quorum:
if: contains(github.event.pull_request.title, 'Quorum') || contains(github.event.pull_request.title, 'quorum')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install npm
npm version
npm install -g ganache-cli
npm install -g truffle
npm install -g truffle-export-abi
- name: Start local node
run: |
nohup ganache-cli --allowUnlimitedContractSize --gasLimit=68219752232 &
sleep 10
- name: Test quorum smartcontracts
run: |
pwd
cd examples/supplychain-app/quorum/smartContracts
truffle test --config ./truffle-config.js