8686 go test -race -count=1 ./... -coverprofile=coverage.txt -covermode=atomic
8787
8888 - name : Coverage
89- run : bash <(curl -s https://codecov.io/bash)
90-
91- build-llm-token-ratelimit :
92- name : Build and test LLM Token Ratelimit - Go ${{ matrix.go_version }}
93- runs-on : ubuntu-latest
94- strategy :
95- # If you want to matrix build , you can append the following list.
96- matrix :
97- go_version :
98- - 1.22.0
99- os :
100- - ubuntu-latest
101- services :
102- redis-node1 :
103- image : redis:6.2-alpine
104- options : >-
105- --entrypoint redis-server
106- --cluster-enabled yes
107- --cluster-config-file nodes-node1.conf
108- --cluster-node-timeout 5000
109- --port 6379
110- ports :
111- - 6379:6379
112- redis-node2 :
113- image : redis:6.2-alpine
114- options : >-
115- --entrypoint redis-server
116- --cluster-enabled yes
117- --cluster-config-file nodes-node2.conf
118- --cluster-node-timeout 5000
119- --port 6380
120- ports :
121- - 6380:6380
122- redis-node3 :
123- image : redis:6.2-alpine
124- options : >-
125- --entrypoint redis-server
126- --cluster-enabled yes
127- --cluster-config-file nodes-node3.conf
128- --cluster-node-timeout 5000
129- --port 6381
130- ports :
131- - 6381:6381
132- steps :
133-
134- - name : Set up Go ${{ matrix.go_version }}
135- uses : actions/setup-go@v3
136- with :
137- go-version : ${{ matrix.go_version }}
138- id : go
139-
140- - name : Check out code into the Go module directory
141- uses : actions/checkout@v3
142-
143- - name : Cache build dependence
144- uses : actions/cache@v3
145- with :
146- # Cache
147- path : ~/go/pkg/mod
148- # Cache key
149- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
150- # An ordered list of keys to use for restoring the cache if no cache hit occurred for key
151- restore-keys : ${{ runner.os }}-go-
152-
153- - name : Setup Redis Cluster
154- run : |
155- sleep 10
156- echo "yes" | redis-cli --cluster create \
157- 127.0.0.1:6379 \
158- 127.0.0.1:6380 \
159- 127.0.0.1:6381 \
160- --cluster-replicas 0
161- redis-cli -h 127.0.0.1 -c -p 6379 cluster info
162- redis-cli -h 127.0.0.1 -c -p 6379 cluster nodes
163-
164- - name : LLM Token Ratelimit Adapter Test
165- env :
166- LLM_API_KEY : ${{ secrets.LLM_API_KEY }}
167- LLM_BASE_URL : ${{ secrets.LLM_BASE_URL }}
168- LLM_MODEL : ${{ secrets.LLM_MODEL }}
169- run : |
170- cd ./pkg/adapters/langchaingo
171- go test -race -count=1 ./... -coverprofile=coverage.txt -covermode=atomic
172- cd ../eino
173- go test -race -count=1 ./... -coverprofile=coverage.txt -covermode=atomic
174-
175- - name : Coverage
176- run : bash <(curl -s https://codecov.io/bash)
89+ run : bash <(curl -s https://codecov.io/bash)
0 commit comments