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 1
105 lines (101 loc) · 3.21 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
name: test
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: setup go and lint
uses: findy-network/setup-go-action@master
with:
linter-config-path: .golangci.yml
skip-scan: true
- name: test
run: make test_cov_out
- name: store coverage file
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-coverage.txt
path: ./coverage.txt
retention-days: 1
services-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- repository: "findy-agent"
- repository: "findy-agent-vault"
- repository: "findy-agent-auth"
steps:
# install indy
- uses: actions/checkout@v3
if: ${{ matrix.repository == 'findy-agent' }}
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
if: ${{ matrix.repository == 'findy-agent' }}
run: make indy_to_debian
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: "findy-network/${{ matrix.repository }}"
ref: dev
path: "./target"
- uses: actions/setup-go@v3
with:
go-version-file: "./go.mod"
- name: test with ${{ matrix.repository }}
run: |
cd ./target
go mod edit -replace github.com/findy-network/findy-common-go=../
go mod tidy -e
go test -p 1 -failfast -timeout=1200s \
-coverpkg=github.com/findy-network/findy-common-go/... \
-coverprofile=coverage-${{ matrix.repository }}.txt \
-covermode=atomic \
./...
- name: store coverage file
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-coverage-${{ matrix.repository }}.txt
path: ./target/coverage-${{ matrix.repository }}.txt
retention-days: 1
env:
FAV_DB_PASSWORD: password
# TODO: move vault to separate test
services:
postgres:
image: postgres:13.8-alpine
ports:
- 5433:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: vault
upload-coverage:
runs-on: ubuntu-latest
needs: [test, services-tests]
steps:
- name: checkout
uses: actions/checkout@v3
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent-vault.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent-auth.txt
- name: upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt,./coverage-findy-agent.txt,./coverage-findy-agent-vault.txt,./coverage-findy-agent-auth.txt
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}