-
Notifications
You must be signed in to change notification settings - Fork 7
176 lines (162 loc) · 5.1 KB
/
ci.yaml
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
170
171
172
173
174
175
176
#
# Copyright 2022 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: conformance-test
env:
# Version of Go
GOVER: "1.20"
# Dapr Socket folder
DAPR_COMPONENT_SOCKETS_FOLDER: /tmp
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
env:
GOLANGCILINT_VER: v1.51.2
GO_VERSION: 1.20.x
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
GOPROXY: https://proxy.golang.org
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: go build -v ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: ${{ env.GOLANGCILINT_VER }}
skip-cache: true
- name: Test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
- name: Codecov
uses: codecov/codecov-action@v1
test:
strategy:
fail-fast: false
matrix:
include:
- component: bindings.kafka
type: bindings
cmd: go run examples/bindings.kafka/main.go &
socket: kafka-pluggable
operations: |
- create
- operations
metadata: |
publishTopic: binding-topic
topics: binding-topic
brokers: localhost:9092
consumerGroup: pubsubgroup1
authRequired: "false"
initialOffset: oldest
- component: pubsub.memory
type: pubsub
socket: memory-pluggable
cmd: go run examples/pubsub.memory/main.go &
operations: |
- publish
- subscribe
- multiplehandlers
- component: pubsub.redis
type: pubsub
socket: redis-pluggable
cmd: go run examples/pubsub.redis/main.go &
test_config: |
checkInOrderProcessing: false
operations: |
- publish
- subscribe
- multiplehandlers
metadata: |
redisHost: localhost:6379
redisPassword: ""
consumerID: "testConsumer"
processingTimeout: 5s
redeliverInterval: 1s
concurrency: 1
- component: pubsub.kafka
type: pubsub
socket: kafka-pluggable
cmd: go run examples/pubsub.kafka/main.go &
operations: |
- publish
- subscribe
- multiplehandlers
metadata: |
brokers: localhost:9092
consumerGroup: pubsubgroup1
authRequired: "false"
initialOffset: oldest
- component: state.redis
type: state
socket: redis-pluggable
cmd: go run examples/state.redis/main.go &
metadata: |
redisHost: localhost:6379
redisPassword: ""
queryIndexes: |
[
{
"name": "qIndx",
"indexes": [
{
"key": "message",
"type": "TEXT"
}
]
}
]
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GOVER }}
- name: Check out code
uses: actions/checkout@v3
- name: Run ${{matrix.component}} dependencies
shell: bash
run: |
DEPENDENCIES=examples/${{matrix.component}}/docker-compose.dependencies.yml
if [ -e $DEPENDENCIES ]; then
docker-compose -f $DEPENDENCIES up -d
fi
- name: Run ${{matrix.component}} component
shell: bash
run: ${{ matrix.cmd }}
- name: Wait for socket
shell: bash
run: |
until [ -S ${{ env.DAPR_COMPONENT_SOCKETS_FOLDER }}/${{ matrix.socket }}.sock ]
do
sleep 5
echo ">>> waiting for socket creation... sleeping"
done
- name: Conformance Tests
uses: dapr-sandbox/action-components-conformance-test@v0.1.0
with:
socket: ${{ env.DAPR_COMPONENT_SOCKETS_FOLDER }}/${{ matrix.socket }}.sock
type: ${{ matrix.type }}
metadata: ${{ matrix.metadata }}
operations: ${{ matrix.operations }}
test_config: ${{ matrix.test_config }}