File tree Expand file tree Collapse file tree 4 files changed +32
-22
lines changed Expand file tree Collapse file tree 4 files changed +32
-22
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,25 @@ permissions:
24
24
contents : read
25
25
26
26
jobs :
27
+ unit-test :
28
+ name : Unit Test
29
+ runs-on : ubuntu-22.04
30
+ permissions :
31
+ contents : read
32
+ strategy :
33
+ matrix :
34
+ go-version : [1.19, 1.20, 1.21]
35
+ steps :
36
+ - name : Checkout Repository
37
+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
38
+
39
+ - name : Setup Golang Environment
40
+ uses : actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
41
+ with :
42
+ go-version : ${{ matrix.go-version }}
43
+
44
+ - name : Run Unit Tests
45
+ run : make unit-test
27
46
build :
28
47
name : Build Client
29
48
runs-on : ubuntu-22.04
61
80
- name : Test Client
62
81
run : |
63
82
docker compose up -d
64
- docker compose logs -f test-nginx test-client test -no-stream
83
+ docker compose logs -f test-integration test-integration -no-stream-block
65
84
66
85
- name : Create/Update Draft
67
86
uses : lucacome/draft-release@f6dc37dcdf44be100a649b72c62c628776750190 # v0.2.2
Original file line number Diff line number Diff line change 1
- test : test-all clean
1
+ test : unit- test test-integration test-integration-no-stream-block clean
2
2
3
3
lint :
4
4
docker run --pull always --rm -v $(shell pwd) :/nginx-plus-go-client -w /nginx-plus-go-client -v $(shell go env GOCACHE) :/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH) /pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run
5
5
6
- test-all :
7
- docker compose up -d --build
8
- docker compose logs -f test-nginx test-client test-no-stream
6
+ unit-test :
7
+ go test -v -shuffle=on -race client/* .go
9
8
10
- test-run :
11
- docker compose up -d --build test-nginx test-client
12
- docker compose logs -f test-nginx test-client
9
+ test-integration :
10
+ docker compose up -d --build test
11
+ docker compose logs -f test
13
12
14
- test-run -no-stream-block :
13
+ test-integration -no-stream-block :
15
14
docker compose up -d --build test-no-stream
16
15
docker compose logs -f test-no-stream
17
16
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ services:
27
27
extends :
28
28
service : nginx
29
29
30
- test-nginx :
30
+ test :
31
31
image : golang:1.21
32
32
volumes :
33
33
- type : bind
34
34
source : ./
35
35
target : /go/src/github.com/nginxinc/nginx-plus-go-client
36
36
working_dir : /go/src/github.com/nginxinc/nginx-plus-go-client
37
- command : /bin/sh -c " go test -v -shuffle=on -race client/*"
37
+ command : go test -v -shuffle=on -race tests/client_test.go
38
38
depends_on :
39
39
- nginx
40
40
- nginx-helper
@@ -43,17 +43,9 @@ services:
43
43
- TEST_API_ENDPOINT_OF_HELPER=http://nginx-helper:8080/api
44
44
- TEST_UNAVAILABLE_STREAM_ADDRESS=nginx:8081
45
45
46
- test-client :
47
- extends :
48
- service : test-nginx
49
- depends_on :
50
- - nginx
51
- - nginx-helper
52
- command : go test -v -shuffle=on -race tests/client_test.go
53
-
54
46
test-no-stream :
55
47
extends :
56
- service : test-nginx
48
+ service : test
57
49
command : go test -v -shuffle=on -race tests/client_no_stream_test.go
58
50
depends_on :
59
51
- nginx-no-stream
Original file line number Diff line number Diff line change 1
- # syntax=docker/dockerfile:1.4
2
- FROM debian:bullseye -slim
1
+ # syntax=docker/dockerfile:1.5
2
+ FROM debian:12 -slim
3
3
4
4
LABEL maintainer="NGINX Docker Maintainers <integrations@nginx.com>"
5
5
You can’t perform that action at this time.
0 commit comments