-
Notifications
You must be signed in to change notification settings - Fork 39
56 lines (52 loc) · 2.04 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
##############################################################################################
# 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@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
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@v3
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install npm
- name: Test smartcontracts using hardhat
run: |
cd examples/supplychain-app/quorum/smartContracts
npm install
npm test