-
Notifications
You must be signed in to change notification settings - Fork 715
189 lines (167 loc) · 7.47 KB
/
test_molecule.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
##############################################################################################
# Copyright Accenture. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##############################################################################################
# This is custom git Action created to run molecule test cases during any push on develop branch
# The workflow is divided into test stages, based on the PR title particular test stages will run
# The test coverage is for Hyperledger Bevel corda and fabric. Other DLTs will be added gradually
name: Test Ansible using Molecule
on:
pull_request:
branches: [ develop ]
types: [opened, edited, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/[email protected]
with:
regex: '\[.*\].*' # Regex the title should match.
allowed_prefixes: '[shared],[docs],[indy],[fabric],[corda],[besu],[quorum],[corda-ent],[substrate],[chore],[ci-skip]' # title should start with the given prefix.
disallowed_prefixes: 'feat/,hotfix' # title should not start with the given prefix.
prefix_case_sensitive: true # title prefix are case sensitive.
min_length: 6 # Min length of the title.
max_length: 100 # Max length of the title.
github_token: ${{ github.token }} # Default: ${{ github.token }}
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install molecule==3.0.6 yamllint ansible-lint docker==4.2.2 openshift jmespath
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install vault && sudo apt-get install build-essential libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev
# Creating symbolic links for the lib for specific requirements.
sudo ln -s /usr/lib/x86_64-linux-gnu/libsodium.so /usr/lib/x86_64-linux-gnu/libsodium.so.18
sudo ln -s /usr/lib/x86_64-linux-gnu/libleveldb.so /usr/lib/x86_64-linux-gnu/libleveldb.so.1
# export the bin path
export PATH=~/bin:$PATH
if: |
contains(github.event.pull_request.title, 'shared') ||
contains(github.event.pull_request.title, 'corda') ||
contains(github.event.pull_request.title, 'fabric') ||
contains(github.event.pull_request.title, 'quorum')
#######################################################################################
#the below test within the /shared folder
- name: Test Stage Shared default
run: |
cd ./platforms/shared/configuration
molecule test -s default
if: contains(github.event.pull_request.title, 'shared')
- name: Test Stage kubernetes-corda
run: |
cd ./platforms/shared/configuration
molecule test -s kubernetes-corda
if: contains(github.event.pull_request.title, 'shared')
- name: Test Stage kubernetes-fabric
run: |
cd ./platforms/shared/configuration
molecule test -s kubernetes-fabric
if: contains(github.event.pull_request.title, 'shared')
- name: Test Stage kubernetes-indy
run: |
cd ./platforms/shared/configuration
molecule test -s kubernetes-indy
if: contains(github.event.pull_request.title, 'shared')
#######################################################################################
#the below test within the /hyperledger-fabric folder
- name: Test Stage Fabric default
run: |
cd ./platforms/hyperledger-fabric/configuration
molecule test -s default
if: contains(github.event.pull_request.title, 'fabric')
- name: Test Stage Fabric crypto
run: |
cd ./platforms/hyperledger-fabric/configuration
molecule test -s crypto
if: contains(github.event.pull_request.title, 'fabric')
- name: Test Stage Fabric orderer
run: |
cd ./platforms/hyperledger-fabric/configuration
molecule test -s orderer
if: contains(github.event.pull_request.title, 'fabric')
- name: Test Stage Fabric peer
run: |
cd ./platforms/hyperledger-fabric/configuration
molecule test -s peer
if: contains(github.event.pull_request.title, 'fabric')
- name: Test Stage Fabric pre-vault-setup
run: |
cd ./platforms/hyperledger-fabric/configuration
molecule test -s pre-vault-setup
if: contains(github.event.pull_request.title, 'fabric')
#######################################################################################
#the below test within the /r3-corder folder
- name: Test Stage Corda default
run: |
cd ./platforms/r3-corda/configuration
molecule test -s default
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda doorman
run: |
cd ./platforms/r3-corda/configuration
molecule test -s doorman
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda notary
run: |
cd ./platforms/r3-corda/configuration
molecule test -s notary
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda networkmap
run: |
cd ./platforms/r3-corda/configuration
molecule test -s networkmap
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda node
run: |
cd ./platforms/r3-corda/configuration
molecule test -s node
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda delete node
run: |
cd ./platforms/r3-corda/configuration
molecule test -s delete_node_flux_gitops
if: contains(github.event.pull_request.title, 'corda')
- name: Test Stage Corda delete notary
run: |
cd ./platforms/r3-corda/configuration
molecule test -s delete_notary
if: contains(github.event.pull_request.title, 'corda')
#######################################################################################
#the below test within the /quorum folder
- name: Test Stage Quorum default
run: |
cd ./platforms/quorum/configuration
molecule test -s default
if: contains(github.event.pull_request.title, 'quorum')
- name: Test Stage Quorum ambassador-certs
run: |
cd ./platforms/quorum/configuration
molecule test -s ambassador-certs
if: contains(github.event.pull_request.title, 'quorum')
- name: Test Stage Quorum crypto-ibft
run: |
cd ./platforms/quorum/configuration
molecule test -s crypto-ibft
if: contains(github.event.pull_request.title, 'quorum')
- name: Test Stage Quorum crypto-tessera
run: |
cd ./platforms/quorum/configuration
molecule test -s crypto-tessera
if: contains(github.event.pull_request.title, 'quorum')
- name: Test Stage Quorum crypto-raft
run: |
cd ./platforms/quorum/configuration
molecule test -s crypto-raft
if: contains(github.event.pull_request.title, 'quorum')
- name: Test Stage Quorum tessera
run: |
cd ./platforms/quorum/configuration
molecule test -s tessera
if: contains(github.event.pull_request.title, 'quorum')