This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
169 lines (157 loc) · 4.99 KB
/
test.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
name: test
on:
push:
jobs:
check:
runs-on: ubuntu-latest
env:
TEST_WORKDIR: /github/home/.test/
CI: true
steps:
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
- name: setup go, lint and scan
uses: findy-network/setup-go-action@master
with:
linter-config-path: .golangci.yml
- name: test and measure coverage (peer did)
run: make test_cov_out COV_FILE=coverage-peer.txt
env:
FCLI_AGENCY_DID_METHOD: "2"
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-peer.txt
path: ./coverage-peer.txt
retention-days: 1
test-default:
runs-on: ubuntu-latest
env:
TEST_WORKDIR: /github/home/.test/
CI: true
steps:
# setup von-network ledger
- uses: actions/checkout@v4
with:
repository: "bcgov/von-network"
ref: "22973513c99cc9a286a6f181ca5c5f354a4eb2ee"
- name: skip setting volumes for web server
run: |
sed '/ - .\/config:\/home\/indy\/config/d' docker-compose.yml > docker-compose.yml.tmp
sed '/ - .\/server:\/home\/indy\/server/d' docker-compose.yml.tmp > docker-compose.yml
- name: start indy ledger
run: |
./manage build
./manage start
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
# setup go-env
- name: setup
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: checkout
uses: actions/checkout@v4
# test round for sov-did (default) and indy ledger
- name: test and measure coverage
run: |
curl http://localhost:9000/genesis > gen_txn_file
make test_grpcv_cov_out COV_FILE=coverage-default.txt
env:
TEST_TIMEOUT: 6000s
TEST_ARGS: "-vmodule=grpc_test*=5 -v=0 -logtostderr"
FCLI_POOL_NAME: "von"
FCLI_AGENCY_POOL_NAME: "FINDY_LEDGER,von"
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-default.txt
path: ./coverage-default.txt
retention-days: 1
e2e:
runs-on: ubuntu-latest
steps:
# install indy
- uses: actions/checkout@v4
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
run: make indy_to_debian
- name: setup
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: checkout
uses: actions/checkout@v4
- name: install cli
run: |
curl https://raw.githubusercontent.com/findy-network/findy-agent-cli/HEAD/install.sh > install.sh
chmod a+x install.sh
sudo ./install.sh -b /bin
- name: test
run: make e2e_ci
- name: Collect docker logs
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: "./tests_output/docker-logs"
- name: archive logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: e2e-logs
path: tests_output
e2e-full:
runs-on: ubuntu-latest
steps:
# TODO: implement graceful shutdown to collect coverage data
- name: test e2e flow
uses: findy-network/e2e-test-action@master
with:
service: "core"
service-context: ./
service-dockerfile: ./scripts/deploy/Dockerfile
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: convert coverage to txt
run: go tool covdata textfmt -i=coverage -o coverage-e2e.txt
- name: store coverage file
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-coverage-e2e.txt
path: ./coverage-e2e.txt
retention-days: 1
upload-coverage:
runs-on: ubuntu-latest
needs: [check, test-default, e2e-full]
steps:
- name: checkout
uses: actions/checkout@v4
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-default.txt
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-peer.txt
- name: download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-coverage-e2e.txt
- name: upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage-default.txt,./coverage-peer.txt,./coverage-e2e.txt
fail_ci_if_error: ${{ github.ref_name != 'dev' }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}