-
-
Notifications
You must be signed in to change notification settings - Fork 18
146 lines (130 loc) · 4.1 KB
/
main.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Builds
on:
push:
branches:
- main
pull_request:
type:
- opened
- synchronize
workflow_dispatch: ~
jobs:
build-test:
runs-on: ubuntu-20.04
container: golang:alpine
services:
redis:
image: redis:6.2.5-alpine3.14
ports:
- 6379/tcp
options: >-
--entrypoint redis-server
jaeger:
image: jaegertracing/all-in-one:1.32.0
node:
image: fabiocicerchia/go-proxy-cache-test:node
#image: fabiocicerchia/npm-start:latest
ports:
- "9001:9001" # ws
- "9002:9002" # wss
#options: >-
# -w /home/node/app
# -v ${{ github.workspace }}/test/full-setup:/home/node/app
collector:
image: otel/opentelemetry-collector:0.35.0
options: >-
-v ${{ github.workspace }}/collector:/etc/otel
# TODO: NEED TO FIND A WAY TO MAKE IT WORKING WITH VOLUMES
nginx:
image: fabiocicerchia/go-proxy-cache-test:nginx
ports:
- "40080:40080" # http
- "40081:40081" # ws
- "40082:40082" # wss
- "40443:40443" # https
options: >-
--link node
--link jaeger
--health-cmd "echo OK"
# -v ${{ github.workspace }}/test/full-setup/nginx:/etc/nginx/conf.d
# -v ${{ github.workspace }}/test/full-setup/certs:/certs
steps:
- uses: actions/checkout@v2
- name: Service Logs - jaeger
uses: docker://docker
with:
args: docker logs "${{ job.services.jaeger.id }}"
# Ref: https://github.saobby.my.eu.orgmunity/t/services-and-volumes/16313
- name: Restart node
uses: docker://docker
with:
args: docker restart "${{ job.services.nginx.id }}"
- name: Service Logs - node
uses: docker://docker
with:
args: docker logs "${{ job.services.node.id }}"
# Ref: https://github.saobby.my.eu.orgmunity/t/services-and-volumes/16313
- name: Restart collector
uses: docker://docker
with:
args: docker restart "${{ job.services.collector.id }}"
- name: Service Logs - collector
uses: docker://docker
with:
args: docker logs "${{ job.services.collector.id }}"
# Ref: https://github.saobby.my.eu.orgmunity/t/services-and-volumes/16313
- name: Restart nginx
uses: docker://docker
with:
args: docker restart "${{ job.services.nginx.id }}"
- name: Service Logs - nginx
uses: docker://docker
with:
args: docker logs "${{ job.services.nginx.id }}"
- name: Install Dependencies
run: |
apk update
apk add bash curl gcc git libc-dev make nghttp2 nodejs npm redis openssh musl-dev net-snmp-dev openssl python3
- name: Build (race)
run: make build-race
- name: Build (multi-arch)
run: make build-multiarch
- name: Test
run: |
echo "127.0.0.1 testing.local www.testing.local" | tee -a /etc/hosts
echo "127.0.0.1 sentry syslog" | tee -a /etc/hosts
cd test/full-setup/certs
./gen-selfsigned-cert.sh
./gen-selfsigned-cert.sh www.w3.org
cd ../../..
./go-proxy-cache -debug -config=test/full-setup/config.yml &
make test
env:
REDIS_HOSTS: redis:6379
NGINX_HOST_80: nginx:40080
NGINX_HOST_443: nginx:40443
NGINX_HOST_WS: nginx:40081
NGINX_HOST_WSS: nginx:40082
- name: Coverage
run: |
echo "127.0.0.1 testing.local www.testing.local" | tee -a /etc/hosts
make cover
make codecov
env:
REDIS_HOSTS: redis:6379
NGINX_HOST_80: nginx:40080
NGINX_HOST_443: nginx:40443
NGINX_HOST_WS: nginx:40081
NGINX_HOST_WSS: nginx:40082
- name: CodeCov
run: make codecov
- name: CodeClimate
continue-on-error: true
run: make codeclimate
sca:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: SCA
continue-on-error: true
run: make sca