-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (61 loc) · 2.05 KB
/
ci.yaml
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
on:
pull_request:
branches: [ main ]
name: CI
env:
IMAGE_NAME: eventstore-cc
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js for use with action
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
uses: actions/setup-node@v2
with:
node-version: '12.16.1'
check-latest: true
- name: Setup Node.js for use with action
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
uses: actions/setup-node@v2-beta
with:
node-version: '12.16.1'
check-latest: true
- name: npm install workaround
run: |
# see https://github.com/rtang03/fabric-es/issues/142
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm --version
nvm install v12.16.1
nvm use v12.16.1
npm install
nvm install v14.0.0
nvm use v14.0.0
npm rebuild grpc
# npm rebuild grpc --target=14.0.0 --target_platform=linux --target_arch=x64 --target_libc=glibc
nvm use v12.16.1
- name: lint chaincode
run: npm run lint
- name: tsc compile
run: npm run build
- name: build chaincode docker image
run: cd dev-net && ./dn-build.sh
- name: deploy base 2-org fabric v2.x network
run: cd dev-net && sudo ./dn-run.2org.sh
- name: Run unit tests for chaincode
run: sudo npm run unit-test:fab
- name: clean-up
run: sudo rm -rf /home/runner/work/abric-es-chaincode/fabric-es-chaincode/dev-net/artifacts