1
1
name : Tests
2
2
3
- on : [push, pull_request]
3
+ on : [pull_request]
4
+
5
+ env :
6
+ KONG_VERSION : master
7
+ BUILD_ROOT : ${{ github.workspace }}/kong/bazel-bin/build
8
+
9
+ concurrency :
10
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress : true
4
12
5
13
jobs :
6
- tests :
7
- name : Tests
8
- runs-on : ubuntu-20.04
9
-
10
- strategy :
11
- matrix :
12
- include :
13
- # TODO: arm64
14
- - openresty : " 1.19.3.2"
15
- luarocks : " 3.7.0"
16
- openssl : " 1.1.1k"
17
- - openresty : " 1.19.9.1"
18
- luarocks : " 3.8.0"
19
- openssl : " 1.1.1m"
20
- - openresty : " 1.21.4.1"
21
- luarocks : " 3.9.1"
22
- openssl : " 1.1.1q"
23
-
24
- env :
25
- JOBS : 1 # must be 1 as socket tests interfere with each other
26
-
27
- INSTALL_ROOT : /home/runner/work/install-root
28
- DOWNLOAD_ROOT : /home/runner/work/download-root
29
-
30
- OPENSSL_INSTALL : /home/runner/work/install-root/openssl
31
- OPENSSL_DIR : /home/runner/work/install-root/openssl
32
- OPENRESTY_INSTALL : /home/runner/work/install-root/openresty
33
- LUAROCKS_INSTALL : /home/runner/work/install-root/luarocks
34
-
35
- BUILD_TOOLS_DOWNLOAD : /home/runner/work/download-root/kong-build-tools
36
- BUILD_TOOLS_BRANCH : master
37
-
38
- OPENRESTY : ${{ matrix.openresty }}
39
- LUAROCKS : ${{ matrix.luarocks }}
40
- OPENSSL : ${{ matrix.openssl }}
14
+ build :
15
+ name : Build dependencies
16
+ runs-on : ubuntu-22.04
41
17
42
18
steps :
43
19
- name : Checkout source code
44
- uses : actions/checkout@v2
20
+ uses : actions/checkout@v3
21
+
22
+ - name : Checkout Kong source code
23
+ uses : actions/checkout@v3
45
24
with :
46
- submodules : ' true'
25
+ repository : kong/kong
26
+ ref : ${{ env.KONG_VERSION }}
27
+ path : kong
47
28
48
- - name : Setup cache
49
- uses : actions/cache@v2
29
+ - name : Lookup build cache
50
30
id : cache-deps
31
+ uses : actions/cache@v3
51
32
with :
52
33
path : |
53
34
${{ env.BUILD_ROOT }}
96
77
- name : Install packages
97
78
run : |
98
79
sudo apt update
99
- sudo apt-get install -qq -y cpanminus net-tools libpcre3-dev build-essential valgrind
80
+ sudo apt install libyaml-dev valgrind libprotobuf-dev cpanminus net-tools libpcre3-dev build-essential
100
81
101
82
- name : Install Test::Nginx
102
83
run : |
@@ -109,21 +90,18 @@ jobs:
109
90
110
91
- name : Run Test
111
92
run : |
112
- export PATH=$OPENSSL_INSTALL/bin:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS_INSTALL/bin:$PATH
113
- export LD_LIBRARY_PATH=$OPENSSL_INSTALL/lib:$LD_LIBRARY_PATH # for openssl's CLI invoked in the test suite
93
+ source ${{ env.BUILD_ROOT }}/kong-dev-venv.sh
114
94
115
95
nginx -V
116
96
resty -V
117
97
luarocks --version
118
98
openssl version
119
99
120
- eval `luarocks path`
121
- prove -j$JOBS -r t
100
+ prove -r t
122
101
123
102
- name : Run Test with Valgrind
124
103
run : |
125
- export PATH=$OPENSSL_INSTALL/bin:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS_INSTALL/bin:$PATH
126
- export LD_LIBRARY_PATH=$OPENSSL_INSTALL/lib:$LD_LIBRARY_PATH # for openssl's CLI invoked in the test suite
104
+ source ${{ env.BUILD_ROOT }}/kong-dev-venv.sh
127
105
128
106
export TEST_NGINX_VALGRIND='--num-callers=100 -q --tool=memcheck --leak-check=full --show-possibly-lost=no --gen-suppressions=all --suppressions=valgrind.suppress --track-origins=yes' TEST_NGINX_TIMEOUT=60 TEST_NGINX_SLEEP=1
129
107
export TEST_NGINX_USE_VALGRIND=1
@@ -133,7 +111,5 @@ jobs:
133
111
luarocks --version
134
112
openssl version
135
113
136
- eval `luarocks path`
137
114
# fail if definite leak found
138
- prove -j$JOBS -r t 2>&1 | tee /dev/stderr | grep -q "match-leak-kinds: definite" && exit 1 || exit 0
139
-
115
+ prove -r t 2>&1 | tee /dev/stderr | grep -q "match-leak-kinds: definite" && exit 1 || exit 0
0 commit comments