feat: allocator-api and shared memory support #175
Workflow file for this run
This file contains hidden or 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: NGINX | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: 'always' | |
RUST_BACKTRACE: '1' | |
NGX_CONFIGURE_CMD: >- | |
auto/configure | |
--with-compat | |
--with-debug | |
--with-http_realip_module | |
--with-http_ssl_module | |
--with-http_v2_module | |
--with-stream | |
--with-stream_realip_module | |
--with-stream_ssl_module | |
NGX_CONFIGURE_UNIX: >- | |
--with-threads | |
NGX_CONFIGURE_WINDOWS: >- | |
--with-cc=cl | |
--prefix= | |
--conf-path=conf/nginx.conf | |
--pid-path=logs/nginx.pid | |
--http-log-path=logs/access.log | |
--error-log-path=logs/error.log | |
--sbin-path=nginx.exe | |
--http-client-body-temp-path=temp/client_body_temp | |
--http-proxy-temp-path=temp/proxy_temp | |
--http-fastcgi-temp-path=temp/fastcgi_temp | |
--http-scgi-temp-path=temp/scgi_temp | |
--http-uwsgi-temp-path=temp/uwsgi_temp | |
--with-cc-opt=-DFD_SETSIZE=1024 | |
--with-pcre=objs/lib/pcre | |
--with-zlib=objs/lib/zlib | |
--with-openssl=objs/lib/openssl | |
--with-openssl-opt="no-asm no-module no-tests -D_WIN32_WINNT=0x0601" | |
NGX_CONFIGURE_DYNAMIC_MODULES: >- | |
--add-dynamic-module=${{ github.workspace }}/examples | |
NGX_CONFIGURE_STATIC_MODULES: >- | |
--add-module=${{ github.workspace }}/examples | |
NGX_TEST_FILES: examples/t | |
NGX_TEST_GLOBALS_DYNAMIC: >- | |
load_module ${{ github.workspace }}/nginx/objs/ngx_http_async_module.so; | |
load_module ${{ github.workspace }}/nginx/objs/ngx_http_awssigv4_module.so; | |
load_module ${{ github.workspace }}/nginx/objs/ngx_http_curl_module.so; | |
load_module ${{ github.workspace }}/nginx/objs/ngx_http_shared_dict_module.so; | |
load_module ${{ github.workspace }}/nginx/objs/ngx_http_upstream_custom_module.so; | |
OPENSSL_VERSION: '3.0.16' | |
PCRE2_VERSION: '10.45' | |
ZLIB_VERSION: '1.3.1' | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
nginx-ref: | |
- master | |
- stable-1.28 | |
module: | |
- static | |
- dynamic | |
include: | |
- nginx-ref: stable-1.24 | |
module: dynamic | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ matrix.nginx-ref }} | |
repository: 'nginx/nginx' | |
path: 'nginx' | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: 'nginx/nginx-tests' | |
path: 'nginx/tests' | |
sparse-checkout: | | |
lib | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
nginx/objs/**/CACHEDIR.TAG | |
nginx/objs/**/ngx-debug | |
nginx/objs/**/ngx-release | |
key: ${{ runner.os }}-nginx-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-nginx- | |
- name: Update configure arguments | |
if: matrix.nginx-ref != 'stable-1.24' | |
run: | | |
echo NGX_CONFIGURE_UNIX="${NGX_CONFIGURE_UNIX} --with-http_v3_module" \ | |
>> "$GITHUB_ENV" | |
- name: Configure nginx with static modules | |
if: matrix.module == 'static' | |
working-directory: nginx | |
run: | | |
${NGX_CONFIGURE_CMD} \ | |
${NGX_CONFIGURE_UNIX} \ | |
${NGX_CONFIGURE_STATIC_MODULES} | |
- name: Configure nginx with dynamic modules | |
if: matrix.module != 'static' | |
working-directory: nginx | |
run: | | |
${NGX_CONFIGURE_CMD} \ | |
${NGX_CONFIGURE_UNIX} \ | |
${NGX_CONFIGURE_DYNAMIC_MODULES} | |
echo TEST_NGINX_GLOBALS="$NGX_TEST_GLOBALS_DYNAMIC" >> "$GITHUB_ENV" | |
- name: Build nginx | |
working-directory: nginx | |
run: make -j$(nproc) | |
- name: Run tests | |
env: | |
PERL5LIB: ${{ github.workspace }}/nginx/tests/lib | |
TEST_NGINX_BINARY: ${{ github.workspace }}/nginx/objs/nginx | |
TEST_NGINX_MODULES: ${{ github.workspace }}/nginx/objs | |
TEST_NGINX_VERBOSE: 1 | |
run: | | |
prove -j$(nproc) --state=save ${NGX_TEST_FILES} || prove -v --state=failed | |
windows: | |
runs-on: windows-2022 | |
env: | |
TEMP: "C:\\TEMP" | |
TMP: "C:\\TEMP" | |
TMPDIR: "C:\\TEMP" | |
VCARCH: x64 | |
strategy: | |
fail-fast: false | |
matrix: | |
nginx-ref: | |
- master | |
module: | |
- static | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ matrix.nginx-ref }} | |
repository: 'nginx/nginx' | |
path: 'nginx' | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
repository: 'nginx/nginx-tests' | |
path: 'nginx/tests' | |
sparse-checkout: | | |
lib | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
nginx/objs/**/CACHEDIR.TAG | |
nginx/objs/**/ngx-debug | |
nginx/objs/**/ngx-release | |
key: ${{ runner.os }}-nginx-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-nginx- | |
- name: Prepare build environment | |
shell: bash | |
working-directory: nginx | |
run: | | |
# Disable dynamic lookup of WSAPoll(); it crashes if the symbol is already imported by | |
# Rust stdlib. | |
sed 's/\(_WIN32_WINNT\s*\) 0x0501/\1 0x0601/' -i src/os/win32/ngx_win32_config.h | |
echo VCVARSALL="$('C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" \ | |
>> "$GITHUB_ENV" | |
mkdir -p $TEMP | |
mkdir -p objs/lib | |
curl -sLO https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz | |
tar -C objs/lib --transform "s/pcre2-$PCRE2_VERSION/pcre/" -xzf ./pcre2-$PCRE2_VERSION.tar.gz | |
echo '#include <stdint.h>' > objs/lib/pcre/src/inttypes.h | |
curl -sLO https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz | |
tar -C objs/lib --transform "s/zlib-$ZLIB_VERSION/zlib/" -xzf ./zlib-$ZLIB_VERSION.tar.gz | |
curl -sLO https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz | |
tar -C objs/lib --transform "s/openssl-$OPENSSL_VERSION/openssl/" -xzf ./openssl-$OPENSSL_VERSION.tar.gz | |
- name: Configure and build nginx | |
shell: cmd | |
working-directory: nginx | |
run: | | |
@echo on | |
call "%VCVARSALL%" %VCARCH% | |
bash.exe ^ | |
%NGX_CONFIGURE_CMD% ^ | |
%NGX_CONFIGURE_WINDOWS% ^ | |
%NGX_CONFIGURE_STATIC_MODULES% | |
nmake -f objs/Makefile | |
- name: Run tests | |
shell: cmd | |
env: | |
PERL5LIB: "${{ github.workspace }}\\nginx\\tests\\lib" | |
TEST_NGINX_BINARY: "${{ github.workspace }}\\nginx\\objs\\nginx.exe" | |
TEST_NGINX_VERBOSE: 1 | |
run: | | |
prove --state=save %NGX_TEST_FILES% || prove -v --state=failed |