docs: README.md #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Checkout repository | |
uses: actions/checkout@v4 | |
- 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=../ --with-cc-opt='-DNGX_HTTP_HEADERS' | |
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 |