9
9
env :
10
10
CARGO_TERM_COLOR : ' always'
11
11
RUST_BACKTRACE : ' 1'
12
- NGX_CONFIGURE : >-
12
+ NGX_CONFIGURE_CMD : >-
13
13
auto/configure
14
14
--with-compat
15
15
--with-debug
19
19
--with-stream
20
20
--with-stream_realip_module
21
21
--with-stream_ssl_module
22
+
23
+ NGX_CONFIGURE_UNIX : >-
22
24
--with-threads
23
25
26
+ NGX_CONFIGURE_WINDOWS : >-
27
+ --with-cc=cl
28
+ --prefix=
29
+ --conf-path=conf/nginx.conf
30
+ --pid-path=logs/nginx.pid
31
+ --http-log-path=logs/access.log
32
+ --error-log-path=logs/error.log
33
+ --sbin-path=nginx.exe
34
+ --http-client-body-temp-path=temp/client_body_temp
35
+ --http-proxy-temp-path=temp/proxy_temp
36
+ --http-fastcgi-temp-path=temp/fastcgi_temp
37
+ --http-scgi-temp-path=temp/scgi_temp
38
+ --http-uwsgi-temp-path=temp/uwsgi_temp
39
+ --with-cc-opt=-DFD_SETSIZE=1024
40
+ --with-pcre=objs/lib/pcre
41
+ --with-zlib=objs/lib/zlib
42
+ --with-openssl=objs/lib/openssl
43
+ --with-openssl-opt="no-asm no-module no-tests -D_WIN32_WINNT=0x0601"
44
+
45
+ OPENSSL_VERSION : ' 3.0.16'
46
+ PCRE2_VERSION : ' 10.45'
47
+ ZLIB_VERSION : ' 1.3.1'
48
+
24
49
jobs :
25
- test :
50
+ linux :
26
51
runs-on : ubuntu-latest
27
52
28
53
strategy :
@@ -68,14 +93,15 @@ jobs:
68
93
- name : Update configure arguments
69
94
if : matrix.nginx-ref != 'stable-1.24'
70
95
run : |
71
- echo NGX_CONFIGURE ="${NGX_CONFIGURE } --with-http_v3_module" \
96
+ echo NGX_CONFIGURE_UNIX ="${NGX_CONFIGURE_UNIX } --with-http_v3_module" \
72
97
>> "$GITHUB_ENV"
73
98
74
99
- name : Configure nginx with static modules
75
100
if : matrix.module == 'static'
76
101
working-directory : nginx
77
102
run : |
78
- ${NGX_CONFIGURE} \
103
+ ${NGX_CONFIGURE_CMD} \
104
+ ${NGX_CONFIGURE_UNIX} \
79
105
--add-module=${{ github.workspace }}/examples
80
106
81
107
- name : Configure nginx with dynamic modules
88
114
load_module ${{ github.workspace }}/nginx/objs/ngx_http_curl_module.so;
89
115
load_module ${{ github.workspace }}/nginx/objs/ngx_http_upstream_custom_module.so;
90
116
run : |
91
- ${NGX_CONFIGURE} \
117
+ ${NGX_CONFIGURE_CMD} \
118
+ ${NGX_CONFIGURE_UNIX} \
92
119
--add-dynamic-module=${{ github.workspace }}/examples
93
120
echo "TEST_NGINX_GLOBALS=$TEST_NGINX_GLOBALS" >> $GITHUB_ENV
94
121
@@ -98,8 +125,97 @@ jobs:
98
125
99
126
- name : Run tests
100
127
env :
128
+ PERL5LIB : ${{ github.workspace }}/nginx/tests/lib
101
129
TEST_NGINX_BINARY : ${{ github.workspace }}/nginx/objs/nginx
102
130
TEST_NGINX_MODULES : ${{ github.workspace }}/nginx/objs
131
+ TEST_NGINX_VERBOSE : 1
132
+ run : |
133
+ prove -j$(nproc) --state=save examples/t || prove -v --state=failed
134
+
135
+ windows :
136
+ runs-on : windows-2022
137
+ env :
138
+ TEMP : " C:\\ TEMP"
139
+ TMP : " C:\\ TEMP"
140
+ TMPDIR : " C:\\ TEMP"
141
+ VCARCH : x64
142
+
143
+ strategy :
144
+ fail-fast : false
145
+ matrix :
146
+ nginx-ref :
147
+ - master
148
+ module :
149
+ - static
150
+
151
+ steps :
152
+ - uses : actions/checkout@v4
153
+ - uses : actions/checkout@v4
154
+ with :
155
+ ref : ${{ matrix.nginx-ref }}
156
+ repository : ' nginx/nginx'
157
+ path : ' nginx'
158
+ - uses : actions/checkout@v4
159
+ with :
160
+ repository : ' nginx/nginx-tests'
161
+ path : ' nginx/tests'
162
+ sparse-checkout : |
163
+ lib
164
+
165
+ - uses : dtolnay/rust-toolchain@stable
166
+
167
+ - uses : actions/cache@v4
168
+ with :
169
+ path : |
170
+ ~/.cargo/bin/
171
+ ~/.cargo/registry/index/
172
+ ~/.cargo/registry/cache/
173
+ ~/.cargo/git/db/
174
+ nginx/objs/ngx_rust_examples
175
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
176
+ restore-keys : ${{ runner.os }}-cargo-
177
+
178
+ - name : Prepare build environment
179
+ shell : bash
180
+ working-directory : nginx
181
+ run : |
182
+ # Disable dynamic lookup of WSAPoll(); it crashes if the symbol is already imported by
183
+ # Rust stdib.
184
+ sed 's/\(_WIN32_WINNT\s*\) 0x0501/\1 0x0601/' -i src/os/win32/ngx_win32_config.h
185
+
186
+ echo "VCVARSALL=$('C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" \
187
+ >> "$GITHUB_ENV"
188
+
189
+ mkdir -p $TEMP
190
+ mkdir -p objs/lib
191
+
192
+ curl -sLO https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz
193
+ tar -C objs/lib --transform "s/pcre2-$PCRE2_VERSION/pcre/" -xzf ./pcre2-$PCRE2_VERSION.tar.gz
194
+ echo '#include <stdint.h>' > objs/lib/pcre/src/inttypes.h
195
+
196
+ curl -sLO https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz
197
+ tar -C objs/lib --transform "s/zlib-$ZLIB_VERSION/zlib/" -xzf ./zlib-$ZLIB_VERSION.tar.gz
198
+
199
+ curl -sLO https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
200
+ tar -C objs/lib --transform "s/openssl-$OPENSSL_VERSION/openssl/" -xzf ./openssl-$OPENSSL_VERSION.tar.gz
201
+
202
+ - name : Configure and build nginx
203
+ shell : cmd
204
+ working-directory : nginx
205
+ run : |
206
+ @echo on
207
+ call "%VCVARSALL%" %VCARCH%
208
+ bash.exe ^
209
+ %NGX_CONFIGURE_CMD% ^
210
+ %NGX_CONFIGURE_WINDOWS% ^
211
+ --add-module=${{ github.workspace }}/examples
212
+ nmake -f objs/Makefile
213
+
214
+ - name : Run tests
215
+ shell : cmd
216
+ env :
217
+ PERL5LIB : " ${{ github.workspace }}\\ nginx\\ tests\\ lib"
218
+ TEST_NGINX_BINARY : " ${{ github.workspace }}\\ nginx\\ objs\\ nginx.exe"
219
+ TEST_NGINX_VERBOSE : 1
103
220
run : |
104
- prove -v -j$(nproc) -Inginx/tests/lib --state=save examples/t \
105
- || prove -v -Inginx/tests/lib --state=failed
221
+ prove --state=save examples/t || prove -v --state=failed
0 commit comments