[njs] Added CI based on GitHub Actions.
noreply at nginx.com
noreply at nginx.com
Tue May 28 23:45:38 UTC 2024
details: https://hg.nginx.org/njs/rev/29ffafd582a7
branches:
changeset: 2341:29ffafd582a7
user: Konstantin Pavlov <thresh at nginx.com>
date: Fri Apr 05 13:27:37 2024 -0700
description:
Added CI based on GitHub Actions.
diffstat:
.github/workflows/check-pr.yml | 86 ++++++++++++++++++++++++++++++++++++++++++
.github/workflows/ci.yml | 11 +++++
2 files changed, 97 insertions(+), 0 deletions(-)
diffs (105 lines):
diff -r 881a1c4cd2fb -r 29ffafd582a7 .github/workflows/check-pr.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.github/workflows/check-pr.yml Fri Apr 05 13:27:37 2024 -0700
@@ -0,0 +1,86 @@
+name: check-pr
+
+on:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: [ ubuntu-latest ]
+ steps:
+ - name: checkout v4
+ uses: actions/checkout at b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Set the defaults and set up environment
+ run: |
+ echo NGINX_CONFIGURE_CMD="auto/configure --prefix=/tmp --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-select_module --with-poll_module --with-http_auth_request_module --with-http_v2_module --with-http_slice_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-threads --with-cpp_test_module --with-compat --with-http_degradation_module --with-http_xslt_module --with-http_image_filter_module --with-http_perl_module --with-http_geoip_module --with-stream_geoip_module" >> $GITHUB_ENV
+ export DEB_BUILD_MAINT_OPTIONS="hardening=+all"
+ export DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC"
+ export DEB_LDFLAGS_MAINT_APPEND=""-Wl,--as-needed""
+ echo CC_OPT=$(dpkg-buildflags --get CFLAGS) >> $GITHUB_ENV
+ echo LD_OPT=$(dpkg-buildflags --get LDFLAGS) >> $GITHUB_ENV
+ echo MAKE_UTILITY=make >> $GITHUB_ENV
+
+ - name: Install build dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install \
+ libssl-dev zlib1g-dev libpcre2-dev libxslt1-dev libgeoip-dev \
+ libgd-dev libxml2-dev libedit-dev libperl-dev libtest-harness-perl \
+ libgd-perl libgeoip-dev expect
+
+ - name: Check out nginx
+ run: |
+ git clone https://github.com/nginx/nginx nginx-source
+
+ - name: Check out nginx tests
+ run: |
+ git clone https://github.com/nginx/nginx-tests
+
+ - name: Check out and build quickjs
+ run: |
+ git clone https://github.com/bellard/quickjs
+ cd quickjs && curl -OL http://pp.nginx.com/pluknet/quickjs.patch && git apply quickjs.patch
+ CFLAGS=$CC_OPT LDFLAGS=$LD_OPT $MAKE_UTILITY -j$(nproc) libquickjs.a
+
+ - name: Configure and make njs
+ run: |
+ ./configure \
+ --cc-opt="$CC_OPT" \
+ --ld-opt="$LD_OPT" \
+ || cat build/autoconf.err
+ $MAKE_UTILITY -j$(nproc)
+
+ - name: Test njs
+ run: |
+ $MAKE_UTILITY test
+ $MAKE_UTILITY clean
+
+ - name: Configure and make njs with quickjs
+ run: |
+ ./configure \
+ --with-quickjs \
+ --cc-opt="$CC_OPT -Iquickjs" \
+ --ld-opt="$LD_OPT -Lquickjs" \
+ || cat build/autoconf.err
+ $MAKE_UTILITY -j$(nproc)
+
+ - name: Test njs with quickjs
+ run: |
+ $MAKE_UTILITY test
+ $MAKE_UTILITY clean
+
+ - name: Configure and build nginx and njs modules
+ run: |
+ cd nginx-source
+ $NGINX_CONFIGURE_CMD --with-cc-opt="$CC_OPT" --with-ld-opt="$LD_OPT" --add-dynamic-module=../nginx || cat objs/autoconf.err
+ $MAKE_UTILITY -j$(nproc) modules
+ $MAKE_UTILITY -j$(nproc)
+
+ - name: Test njs modules
+ run: |
+ ulimit -c unlimited
+ prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
+ env:
+ TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
+ TEST_NGINX_GLOBALS: "load_module ${{ github.workspace }}/nginx-source/objs/ngx_http_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so;"
+ TEST_NGINX_VERBOSE: 1
diff -r 881a1c4cd2fb -r 29ffafd582a7 .github/workflows/ci.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.github/workflows/ci.yml Fri Apr 05 13:27:37 2024 -0700
@@ -0,0 +1,11 @@
+name: CI
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - master
+
+jobs:
+ buildbot:
+ uses: nginx/ci-self-hosted/.github/workflows/njs-buildbot.yml at main
More information about the nginx-devel
mailing list