Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,69 @@ jobs:
run: |
prove -j$(nproc) --state=save ${NGX_TEST_FILES} || prove -v --state=failed

macos:
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
nginx-ref:
- stable-1.30
module:
- static

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ matrix.nginx-ref }}
repository: 'nginx/nginx'
path: 'nginx'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: 'nginx/nginx-tests'
path: 'nginx/tests'
sparse-checkout: |
lib

- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable

- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
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: Configure nginx with static modules
working-directory: nginx
run: |
${NGX_CONFIGURE_CMD} \
${NGX_CONFIGURE_UNIX} \
${NGX_CONFIGURE_STATIC_MODULES}

- name: Build nginx
working-directory: nginx
run: make -j$(sysctl -n hw.ncpu)

- 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$(sysctl -n hw.ncpu) --state=save ${NGX_TEST_FILES} \
|| prove -v --state=failed

windows:
runs-on: windows-2022
env:
Expand Down
5 changes: 5 additions & 0 deletions examples/t/awssig.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ use Test::Nginx;
select STDERR; $| = 1;
select STDOUT; $| = 1;

# The example is not built on Darwin: chrono reaches the local timezone
# through CoreFoundation, which is not fork-safe. See examples/config.
plan(skip_all => 'awssig example is not built on this platform')
if $^O eq 'darwin';

my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(1)
->write_file_expand('nginx.conf', <<"EOF");

Expand Down
7 changes: 6 additions & 1 deletion examples/t/shared_dict.t
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ sub check {

my $pid = $1;

for (1 .. 25) {
for (1 .. 60) {
# Back-to-back requests keep landing on the worker that is
# already awake. Pause so the kernel has a reason to wake
# the other one.
select(undef, undef, undef, 0.2);

$r = http_get($uri);

return unless ($r =~ $like && $r =~ /X-Process: (\d+)/);
Expand Down