-
Notifications
You must be signed in to change notification settings - Fork 2.5k
122 lines (118 loc) · 4.75 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
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
name: test tengine
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
runs-on: "ubuntu-20.04"
strategy:
fail-fast: false
matrix:
compiler:
- { compiler: GNU, CC: gcc, CXX: g++}
- { compiler: LLVM, CC: clang, CXX: clang++}
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 libpcre++0v5 libpcre++-dev liblua5.1-0-dev lua5.1 libperl-dev cpanminus libssl-dev
- name: 'checkout luajit2'
uses: actions/checkout@v3
with:
repository: openresty/luajit2
path: luajit2
- name: 'build luajit2'
working-directory: luajit2
run: |
make
sudo make install
- name: 'checkout lua-resty-lrucache'
uses: actions/checkout@v3
with:
repository: openresty/lua-resty-lrucache
path: lua-resty-lrucache
- name: 'build lua-resty-lrucache'
working-directory: lua-resty-lrucache
run: |
sudo make install
- name: 'checkout lua-resty-core'
uses: actions/checkout@v3
with:
repository: openresty/lua-resty-core
ref: v0.1.27
path: lua-resty-core
- name: 'build lua-resty-core'
working-directory: lua-resty-core
run: |
sudo make install
# TODO: fix tests so they don't depend on /usr/local/nginx/logs/
# so we can run `make`, `make test`, `make install`.
- name: build
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
LUAJIT_LIB: /usr/local/lib
LUAJIT_INC: /usr/local/include/luajit-2.1
run: |
./configure \
--with-debug \
--with-ld-opt="-Wl,-lpcre,-rpath,/usr/local/lib" \
--with-ipv6 \
--with-openssl-async \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_addition_module \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_geoip_module \
--with-stream_ssl_preread_module \
--with-stream_sni \
--add-module=./modules/ngx_backtrace_module \
--add-module=./modules/ngx_debug_pool \
--add-module=./modules/ngx_debug_timer \
--add-module=./modules/ngx_debug_conn \
--add-module=./modules/ngx_http_concat_module \
--add-module=./modules/ngx_http_footer_filter_module \
--add-module=./modules/ngx_http_lua_module \
--add-module=./modules/ngx_http_proxy_connect_module \
--add-module=./modules/ngx_http_reqstat_module \
--add-module=./modules/ngx_http_slice_module \
--add-module=./modules/ngx_http_sysguard_module \
--add-module=./modules/ngx_http_trim_filter_module \
--add-module=./modules/ngx_http_upstream_check_module \
--add-module=./modules/ngx_http_upstream_consistent_hash_module \
--add-module=./modules/ngx_http_upstream_dynamic_module \
--add-module=./modules/ngx_http_upstream_dyups_module \
--add-module=./modules/ngx_http_upstream_iwrr_module \
--add-module=./modules/ngx_http_upstream_keepalive_module \
--add-module=./modules/ngx_http_upstream_session_sticky_module \
--add-module=./modules/ngx_http_upstream_vnswrr_module \
--add-module=./modules/ngx_http_user_agent_module \
--add-module=./modules/ngx_multi_upstream_module \
--add-module=./modules/ngx_slab_stat \
--without-http_upstream_keepalive_module
make -j2
sudo make install
- name: tengine test cases using nginx-tests lib
working-directory: tests/nginx-tests
env:
TEST_NGINX_BINARY: /usr/local/nginx/sbin/nginx
run: |
sudo cpanm --notest Net::DNS::Nameserver > build.log 2>&1 || (cat build.log && exit 1)
prove -v -Inginx-tests/lib tengine-tests/
prove -v -Inginx-tests/lib ../../modules/ngx_http_proxy_connect_module/t
prove -v -Inginx-tests/lib ../../modules/ngx_debug_timer/t
prove -v -Inginx-tests/lib ../../modules/ngx_debug_conn/t
prove -v -Inginx-tests/lib ../../modules/ngx_slab_stat/t
- name: tengine test cases using test-nginx lib
working-directory: tests/test-nginx
run: |
sudo cpanm --notest Shell Test::Base Test::LongString List::MoreUtils LWP::UserAgent HTTP::Response > build.log 2>&1 || (cat build.log && exit 1)
mkdir t
PATH=/usr/local/nginx/sbin:$PATH \
prove -v -Itest-nginx/lib cases/