-
Notifications
You must be signed in to change notification settings - Fork 493
94 lines (90 loc) · 3.13 KB
/
ci.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
name: test nginx
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test-nginx:
strategy:
matrix:
version: [1.24.0, 1.25.0]
fail-fast: false
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v3
- name: get dependencies
run: |
sudo apt update
sudo apt remove nginx libgd3
sudo apt install -y libgd-dev libgeoip-dev libxslt1-dev libperl-dev
sudo apt install -y libpcre3 libpcre3-dev
sudo apt-get install libnet-dns-perl
sudo cpan -T -i Test::More
- name: 'checkout luajit2'
uses: actions/checkout@v3
with:
repository: openresty/luajit2
path: luajit2
- name: install luajit
working-directory: luajit2
run: |
pwd
make -j
sudo make install
ls /usr/local/lib/ |grep lua
- name: get lua-nginx-module source
run: |
git clone https://github.com/openresty/lua-nginx-module.git
cd lua-nginx-module
git checkout b754786bb507ab76f8bfae2fc88aa59a959908a1
- name: get nginx source
run: |
pwd
wget https://nginx.org/download/nginx-${{ matrix.version }}.tar.gz
tar xf nginx-${{ matrix.version }}.tar.gz
mv nginx-${{ matrix.version }} nginx
- name: build
run: |
pwd
cd nginx
patch -p1 < ../patch/proxy_connect_rewrite_102101.patch
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.1
./configure --prefix=/opt/nginx --with-ld-opt="-lpcre -Wl,-rpath,$LUAJIT_LIB" --add-module=../ --add-module=../lua-nginx-module
make -j
sudo make install
- name: install lua-resty-core
run: |
pwd
git clone https://github.com/openresty/lua-resty-core.git
cd lua-resty-core
git checkout d2179dbcb3d6d77127462cadd40cca103d89a52a
sudo make install PREFIX=/opt/nginx
cd ..
git clone https://github.com/openresty/lua-resty-lrucache.git
cd lua-resty-lrucache
sudo make install PREFIX=/opt/nginx
ls /opt/nginx/lib/lua
- name: check nginx binary
run: |
cd nginx
ls -l objs/nginx /opt/nginx/sbin/nginx
ldd objs/nginx|grep -i lua
echo "Is there nginx worker?"; ps aux|grep nginx
echo "LD PATH: $LD_LIBRARY_PATH"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
objs/nginx -V
- name: get nginx-tests
run: git clone https://github.com/nginx/nginx-tests
- name: test
run: |
pwd
cd nginx
#sed -i -e "s+#LUA_PACKAGE_PATH+lua_package_path \"/opt/nginx/lib/lua/?.lua;;\";+" ../t/*.t
#grep -i lua_package_path ../t/*.t
export TEST_NGINX_GLOBALS_HTTP='lua_package_path "/opt/nginx/lib/lua/?.lua;;";'
nginx_tests_lib_path=../nginx-tests/lib
proxy_connect_test_cases=../t/
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
TEST_NGINX_UNSAFE=yes TEST_NGINX_BINARY=$(pwd)/objs/nginx prove -v -I $nginx_tests_lib_path $proxy_connect_test_cases