forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (102 loc) · 3.73 KB
/
test_weaver-node-pkgs.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: CC-BY-4.0
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Unit Test Weaver Node Packages
env:
NODEJS_LTS_VERSION: v18.18.2
NODEJS_NEXT_LTS_VERSION: v20.9.0
on:
push:
branches: [ main ]
paths:
- '.github/workflows/test_weaver-**'
- 'weaver/common/protos-js/**'
- 'weaver/sdks/fabric/interoperation-node-sdk/**'
- 'weaver/core/identity-management/**'
- 'weaver/docs/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/test_weaver-**'
- 'weaver/common/protos-js/**'
- 'weaver/sdks/fabric/interoperation-node-sdk/**'
- 'weaver/core/identity-management/**'
- 'weaver/docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit_test_weaver_node_sdk_local:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [v18.18.2, v20.9.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Use Protoc 3.15
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- name: Build JS Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-js
- name: Build
run: make build-local
working-directory: weaver/sdks/fabric/interoperation-node-sdk
- name: Tests
run: npm run test
working-directory: weaver/sdks/fabric/interoperation-node-sdk
unit_test_iin_agent_local:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [v18.18.2]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Use Protoc 3.15
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- name: Build JS Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-js
- name: Build
run: make build-local
working-directory: weaver/sdks/fabric/interoperation-node-sdk
- name: Build IIN Agent
run: make build-local
working-directory: weaver/core/identity-management/iin-agent
- name: Tests
run: npm run test
working-directory: weaver/core/identity-management/iin-agent
build_docs:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Use Node.js ${{ env.NODEJS_LTS_VERSION }}
uses: actions/[email protected]
with:
node-version: ${{ env.NODEJS_LTS_VERSION }}
- name: NPM INSTALL
run: npm install
working-directory: weaver/docs
- name: Build
run: npm run build
working-directory: weaver/docs