-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (55 loc) · 2.18 KB
/
test.yaml
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
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'ci skip') == false
strategy:
matrix:
optional:
- ''
- 'NGX_KEYVAL_ZONE_REDIS'
- 'NGX_HTTP_KEYVAL_ZONE_REDIS' # deprecated
container:
image: alpine:latest
steps:
- name: Prepare required command
run: |
apk --no-cache upgrade
apk --no-cache add curl gcc gd-dev geoip-dev git hiredis-dev libxslt-dev linux-headers make musl-dev nginx openssl-dev pcre-dev perl-dev perl-utils redis zlib-dev
cpan -Ti Test::Nginx
env:
PERL_MM_USE_DEFAULT: 1
- name: Add github workspace as safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout repository
uses: actions/checkout@v3
- name: Build
run: |
if [ -n "${NGX_OPTION}" ]; then
export "${NGX_OPTION}"=1
fi
nginx_version=$(nginx -v 2>&1 | sed 's/^[^0-9]*//')
curl -sL -o nginx-${nginx_version}.tar.gz http://nginx.org/download/nginx-${nginx_version}.tar.gz
tar xf nginx-${nginx_version}.tar.gz
cd nginx-${nginx_version}
opt=$(nginx -V 2>&1 | tail -1 | sed -e 's/configure arguments://' -e 's| --add-dynamic-module=[^ ]*||g')
./configure ${opt} --add-dynamic-module=../
make
mkdir -p /usr/lib/nginx/modules
cp objs/ngx_http_keyval_module.so /usr/lib/nginx/modules/
cp objs/ngx_stream_keyval_module.so /usr/lib/nginx/modules/
cp objs/ngx_stream_module.so /usr/lib/nginx/modules/
env:
NGX_OPTION: ${{ matrix.optional }}
- name: Test
run: |
if [ -n "${NGX_OPTION}" ]; then
export "${NGX_OPTION}"=1
fi
redis-server --daemonize yes
prove -v -r t 2> /dev/null
env:
NGX_OPTION: ${{ matrix.optional }}
TEST_NGINX_LOAD_MODULES: "/usr/lib/nginx/modules/ngx_http_keyval_module.so /usr/lib/nginx/modules/ngx_stream_module.so /usr/lib/nginx/modules/ngx_stream_keyval_module.so"
TEST_NGINX_SERVROOT: /tmp/servroot