Skip to content

Commit 5f7ebe2

Browse files
committed
fixup! ci: test windows builds
1 parent 35aafc9 commit 5f7ebe2

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

.github/workflows/nginx.yaml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ env:
4242
--with-openssl=objs/lib/openssl
4343
--with-openssl-opt="no-asm no-module no-tests -D_WIN32_WINNT=0x0601"
4444
45+
NGX_CONFIGURE_DYNAMIC_MODULES: >-
46+
--add-dynamic-module=${{ github.workspace }}/examples
47+
NGX_CONFIGURE_STATIC_MODULES: >-
48+
--add-module=${{ github.workspace }}/examples
49+
50+
NGX_TEST_FILES: examples/t
51+
NGX_TEST_GLOBALS_DYNAMIC: >-
52+
load_module ${{ github.workspace }}/nginx/objs/ngx_http_async_module.so;
53+
load_module ${{ github.workspace }}/nginx/objs/ngx_http_awssigv4_module.so;
54+
load_module ${{ github.workspace }}/nginx/objs/ngx_http_curl_module.so;
55+
load_module ${{ github.workspace }}/nginx/objs/ngx_http_upstream_custom_module.so;
56+
4557
OPENSSL_VERSION: '3.0.16'
4658
PCRE2_VERSION: '10.45'
4759
ZLIB_VERSION: '1.3.1'
@@ -86,9 +98,11 @@ jobs:
8698
~/.cargo/registry/index/
8799
~/.cargo/registry/cache/
88100
~/.cargo/git/db/
89-
nginx/objs/ngx_rust_examples
90-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
91-
restore-keys: ${{ runner.os }}-cargo-
101+
nginx/objs/**/CACHEDIR.TAG
102+
nginx/objs/**/ngx-debug
103+
nginx/objs/**/ngx-release
104+
key: ${{ runner.os }}-nginx-${{ hashFiles('**/Cargo.lock') }}
105+
restore-keys: ${{ runner.os }}-nginx-
92106

93107
- name: Update configure arguments
94108
if: matrix.nginx-ref != 'stable-1.24'
@@ -102,22 +116,16 @@ jobs:
102116
run: |
103117
${NGX_CONFIGURE_CMD} \
104118
${NGX_CONFIGURE_UNIX} \
105-
--add-module=${{ github.workspace }}/examples
119+
${NGX_CONFIGURE_STATIC_MODULES}
106120
107121
- name: Configure nginx with dynamic modules
108122
if: matrix.module != 'static'
109123
working-directory: nginx
110-
env:
111-
TEST_NGINX_GLOBALS: >-
112-
load_module ${{ github.workspace }}/nginx/objs/ngx_http_async_module.so;
113-
load_module ${{ github.workspace }}/nginx/objs/ngx_http_awssigv4_module.so;
114-
load_module ${{ github.workspace }}/nginx/objs/ngx_http_curl_module.so;
115-
load_module ${{ github.workspace }}/nginx/objs/ngx_http_upstream_custom_module.so;
116124
run: |
117125
${NGX_CONFIGURE_CMD} \
118126
${NGX_CONFIGURE_UNIX} \
119-
--add-dynamic-module=${{ github.workspace }}/examples
120-
echo "TEST_NGINX_GLOBALS=$TEST_NGINX_GLOBALS" >> $GITHUB_ENV
127+
${NGX_CONFIGURE_DYNAMIC_MODULES}
128+
echo TEST_NGINX_GLOBALS="$NGX_TEST_GLOBALS_DYNAMIC" >> "$GITHUB_ENV"
121129
122130
- name: Build nginx
123131
working-directory: nginx
@@ -130,7 +138,7 @@ jobs:
130138
TEST_NGINX_MODULES: ${{ github.workspace }}/nginx/objs
131139
TEST_NGINX_VERBOSE: 1
132140
run: |
133-
prove -j$(nproc) --state=save examples/t || prove -v --state=failed
141+
prove -j$(nproc) --state=save ${NGX_TEST_FILES} || prove -v --state=failed
134142
135143
windows:
136144
runs-on: windows-2022
@@ -171,19 +179,21 @@ jobs:
171179
~/.cargo/registry/index/
172180
~/.cargo/registry/cache/
173181
~/.cargo/git/db/
174-
nginx/objs/ngx_rust_examples
175-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
176-
restore-keys: ${{ runner.os }}-cargo-
182+
nginx/objs/**/CACHEDIR.TAG
183+
nginx/objs/**/ngx-debug
184+
nginx/objs/**/ngx-release
185+
key: ${{ runner.os }}-nginx-${{ hashFiles('**/Cargo.lock') }}
186+
restore-keys: ${{ runner.os }}-nginx-
177187

178188
- name: Prepare build environment
179189
shell: bash
180190
working-directory: nginx
181191
run: |
182192
# Disable dynamic lookup of WSAPoll(); it crashes if the symbol is already imported by
183-
# Rust stdib.
193+
# Rust stdlib.
184194
sed 's/\(_WIN32_WINNT\s*\) 0x0501/\1 0x0601/' -i src/os/win32/ngx_win32_config.h
185195
186-
echo "VCVARSALL=$('C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" \
196+
echo VCVARSALL="$('C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" \
187197
>> "$GITHUB_ENV"
188198
189199
mkdir -p $TEMP
@@ -208,7 +218,7 @@ jobs:
208218
bash.exe ^
209219
%NGX_CONFIGURE_CMD% ^
210220
%NGX_CONFIGURE_WINDOWS% ^
211-
--add-module=${{ github.workspace }}/examples
221+
%NGX_CONFIGURE_STATIC_MODULES%
212222
nmake -f objs/Makefile
213223
214224
- name: Run tests
@@ -218,4 +228,4 @@ jobs:
218228
TEST_NGINX_BINARY: "${{ github.workspace }}\\nginx\\objs\\nginx.exe"
219229
TEST_NGINX_VERBOSE: 1
220230
run: |
221-
prove --state=save examples/t || prove -v --state=failed
231+
prove --state=save %NGX_TEST_FILES% || prove -v --state=failed

0 commit comments

Comments
 (0)