-
Notifications
You must be signed in to change notification settings - Fork 17
122 lines (109 loc) · 3.11 KB
/
Copy pathci.yml
File metadata and controls
122 lines (109 loc) · 3.11 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
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: CI
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
env:
DB_DEPLOYMENT: local
jobs:
lint:
name: Lint and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- name: Lint
run: |
# Apply automatic formatting.
gofmt -w .
goimports -local "github.com/hyperledger/fabric-x-committer" -w .
# Re make protobufs, overwriting any formatting
PATH="$HOME/bin:$PATH" make proto
# Check if original code changed due to formatting.
git diff --exit-code
# Fetch main to only show new lint issues.
git fetch -u origin main:main
make lint
- name: Build
run: make build
unit-test:
name: Unit Test (non DB)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-no-db
fuzz-test:
name: Fuzz Test (non DB)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-fuzz
db-test:
name: Requires and Core DB Tests (postgres)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: scripts/get-and-start-postgres.sh
- run: make test-requires-db test-core-db
core-db-test:
name: Core DB Tests (yugabyte)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: scripts/get-and-start-yuga.sh
- run: make test-core-db
integration-test:
name: Integration Tests (yugabyte)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: scripts/get-and-start-yuga.sh
- run: make test-integration
db-resiliency-test:
name: Integration DB Resiliency (container)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-integration-db-resiliency
container-test:
name: Build and test all-in-one test image (container)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-container