-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (116 loc) · 3.13 KB
/
go.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
name: Go
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
env:
GO_VER: 1.22.4
GO_VER_OLD: 1.18.7
GINKGO_VER: 2.13.2
jobs:
check-cyrillic-comments:
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- name: check cyrillic comments
run: |
grep --exclude-dir={.git,.github} -I -r --color -n -E "[А-Яа-яЁё]+" . && exit 1 || exit 0
validate-go:
needs:
- check-cyrillic-comments
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
- name: check go.mod
run: |
go mod tidy
git diff --exit-code go.mod
- name: go fmt
run: |
go fmt ./...
git diff --exit-code
golangci-lint:
needs:
- validate-go
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.59
args: --out-format=colored-line-number
skip-cache: true
go-test-unit:
needs:
- golangci-lint
strategy:
fail-fast: false
matrix:
go-version:
- '1.22.4'
- '1.18.7'
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: unit test
run: |
go test -count 1 ./...
go-test-coverage:
needs:
- golangci-lint
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
- name: generate test coverage
run: |
go test ./... -coverprofile=./coverage.out
# https://github.com/vladopajic/go-test-coverage
- uses: vladopajic/go-test-coverage@v2.10.0
with:
config: ./.testcoverage.yml
profile: coverage.out
local-prefix: github.com/${{ github.repository }}
go-test-integration:
needs:
- golangci-lint
strategy:
fail-fast: false
matrix:
INTEGRATION_TEST_SUITE: [ "config","emission" ]
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}
- name: redis
run: docker pull redis:7.2.4
- name: fabric-ccenv
run: docker pull hyperledger/fabric-ccenv:latest
- name: fabric-baseos
run: docker pull hyperledger/fabric-baseos:latest
- name: install ginkgo
run: go install github.com/onsi/ginkgo/v2/ginkgo@v${{ env.GINKGO_VER }}
- name: integration test
working-directory: ./tests/integration
run: |
ginkgo --keep-going --poll-progress-after 60s --timeout 24h ${{matrix.INTEGRATION_TEST_SUITE}}