-
Notifications
You must be signed in to change notification settings - Fork 1
153 lines (134 loc) · 5.29 KB
/
production_network_test.yml
File metadata and controls
153 lines (134 loc) · 5.29 KB
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
name: Hyperledger_Scala_With_Production_Network
on:
# daily
schedule:
- cron: '0 0 * * *'
# manual trigger
workflow_dispatch:
inputs:
chaincode_target:
description: 'Chaincode Target Version (empty = latest Release)'
required: true
default: ''
test_set:
description: 'Define which tests to run'
required: true
default: '*AdmissionTests *AdmissionTests_Exam *CertificateAccessTests *CertificateErrorTests *ExamTests *ExaminationRegulationAccessTests *ExaminationRegulationErrorTests *ExamResultTests *GroupTests *HelperTests *InternalManagerTests *MatriculationErrorTests *MatriculationAccessTests *OperationTests *VersionAccessTests *UserManagementTests *UnsignedTransactionTests'
# on push event
push:
# except for these files
paths-ignore:
- '**.md'
- '**.JPG'
- LICENSE
- .github/workflows/dev_network_test.yml
- .github/workflows/no_network_test.yml
- .github/workflows/style_check.yaml
- .github/workflows/publish_to_sonatype.yaml
- .github/actions/dev_network_setup/action.yml
# on pull request to protected branches
pull_request:
branches:
- develop
- main
# except for these files
paths-ignore:
- '**.md'
- '**.JPG'
- LICENSE
- .github/workflows/dev_network_test.yml
- .github/workflows/no_network_test.yml
- .github/workflows/style_check.yaml
- .github/workflows/publish_to_sonatype.yaml
- .github/actions/dev_network_setup/action.yml
jobs:
DeployAndTestProductionNetwork:
env:
TEST_SET: '*AdmissionTests *AdmissionTests_Exam *CertificateAccessTests *CertificateErrorTests *ExamTests *ExaminationRegulationAccessTests *ExaminationRegulationErrorTests *ExamResultTests *GroupTests *HelperTests *InternalManagerTests *MatriculationErrorTests *MatriculationAccessTests *OperationTests *VersionAccessTests *UserManagementTests *UnsignedTransactionTests'
CHAINCODE_TARGET: ""
runs-on: ubuntu-latest
steps:
# ################### ENV VARS ############################################################ #
# Rewrite test_Set if started manually
- name: rewrite test_set if manual invocation
if: github.event.inputs.test_set != ''
run: echo "TEST_SET=${{ github.event.inputs.test_set }}" >> $GITHUB_ENV
# Rewrite chaincodeTarget if started manually
- name: rewrite chaincodeTarget if manual invocation
if: github.event.inputs.chaincode_target != ''
run: echo "CHAINCODE_TARGET=${{ github.event.inputs.chaincode_target }}" >> $GITHUB_ENV
# ################### ENV VARS ############################################################ #
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out source repository
uses: actions/checkout@v2
# Set up JDK
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# ################### PRODUCTION NETWORK ############ #
# Checks out production network
- name : Check out production network
uses: actions/checkout@v2
with:
repository: 'upb-uc4/hlf-network'
ref: 'develop'
path: 'hlf-network'
# Prepare mounts
- name: Create folder for mounts of default cluster
run: |
sudo mkdir -p /data/development/hyperledger
sudo chmod -R 777 /data/development
# start kind
- name: Start KinD with default cluster config
uses: engineerd/setup-kind@v0.5.0
with:
version: "v0.7.0"
config: hlf-network/assets/kind.yaml
# install faketime
- name: (Temporary) install faketime to prevent clockdrifts
run: sudo apt-get install faketime
# Setup Network
- name: setup production network
uses: ./.github/actions/production_network_setup
with:
network_folder: 'hlf-network'
chaincode_branch: $CHAINCODE_TARGET
# check nodes
- name: Check kubernetes nodes
run: kubectl get nodes -o wide
# check kind worker ip
- name: Check kind worker ip
run: |
printf "Using worker node at: %s\n" $UC4_KIND_NODE_IP
# ################### PRODUCTION NETWORK ############ #
# ################### TEST WITH REPORTS ############# #
# Run Tests
- name: run tests with coverage and reports
uses: NikoBergemann/action-sbt-test-report@v3
with:
what-to-test: $TEST_SET
env:
UC4_TESTBASE_TARGET: 'PRODUCTION_NETWORK'
COVERAGE_MINIMUM: '70'
# Combine reports
- name: Scalatest multiproject HTML merger
uses: bastihav/scalatest-multiproject-html-action@v1
if: always()
with:
path: target/test_reports/
# Upload Test Report
- name: Upload test report
uses: actions/upload-artifact@v1
if: always()
with:
name: test-reports
path: target/test_reports/
# Upload Coverage Report
- name: Upload coverage report
uses: actions/upload-artifact@v1
if: always()
with:
name: code-coverage
path: target/scoverage-report
# ################### TEST WITH REPORTS ############# #