mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-15 17:12:14 +03:00
test x86
This commit is contained in:
181
.github/workflows/test-ci-windows.yml
vendored
181
.github/workflows/test-ci-windows.yml
vendored
@@ -9,106 +9,113 @@ on:
|
|||||||
- v2/test-ci-windows
|
- v2/test-ci-windows
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-winget:
|
build:
|
||||||
name: Test winget availability
|
strategy:
|
||||||
runs-on: windows-latest # 使用最新的 Windows Server 运行器
|
matrix:
|
||||||
|
arch: [x86, x64]
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
# For Caching
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check if winget is installed
|
- name: Checkout code
|
||||||
run: |
|
uses: actions/checkout@v5
|
||||||
# 检查 winget 是否可用
|
|
||||||
winget --version
|
- name: Install Apache for x86
|
||||||
if ($LASTEXITCODE -eq 0) {
|
if: matrix.arch == 'x86'
|
||||||
Write-Host "✅ winget is installed and working correctly"
|
|
||||||
} else {
|
|
||||||
Write-Error "❌ winget is not available or not functioning properly"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
shell: pwsh # 使用 PowerShell 作为 shell
|
|
||||||
|
|
||||||
- name: Optional - List installed packages (if winget is available)
|
|
||||||
if: success()
|
|
||||||
run: |
|
|
||||||
# 列出已安装的包以验证 winget 功能
|
|
||||||
winget list --name "Microsoft Visual C++"
|
|
||||||
Write-Host "winget functionality verified successfully"
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
run: |
|
||||||
# jobs:
|
$apachePath = "${{ github.workspace }}\apache-x86"
|
||||||
# build:
|
New-Item -ItemType Directory -Path $apachePath -Force
|
||||||
# runs-on: windows-latest
|
choco install apache-httpd -y --force --forcex86 --params="`"/installLocation:$apachePath /noService`""
|
||||||
|
# 设置环境变量供后续步骤使用
|
||||||
# # For Caching
|
echo "APACHE_ROOT=$apachePath\Apache24" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# permissions:
|
|
||||||
# actions: read
|
|
||||||
# contents: read
|
|
||||||
|
|
||||||
# steps:
|
- name: Set Apache path for x64
|
||||||
# - name: Checkout code
|
if: matrix.arch == 'x64'
|
||||||
# uses: actions/checkout@v5
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
# 对于 x64,使用预装的 Apache
|
||||||
|
echo "APACHE_ROOT=C:\tools\Apache24" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
|
||||||
# - name: Setup MSYS2
|
- name: Setup MSYS2
|
||||||
# uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
# with:
|
with:
|
||||||
# msystem: UCRT64
|
msystem: ${{ matrix.arch == 'x86' && 'MINGW32' || 'UCRT64' }}
|
||||||
# update: true
|
update: true
|
||||||
# install: >
|
install: >
|
||||||
# git
|
git
|
||||||
# make
|
make
|
||||||
# autoconf
|
autoconf
|
||||||
# automake
|
automake
|
||||||
# libtool
|
libtool
|
||||||
# mingw-w64-ucrt-x86_64-gcc
|
${{ matrix.arch == 'x86' && 'mingw-w64-ucrt-i686-gcc' || 'mingw-w64-ucrt-x86_64-gcc' }}
|
||||||
# mingw-w64-ucrt-x86_64-pkg-config
|
${{ matrix.arch == 'x86' && 'mingw-w64-ucrt-i686-pkg-config' || 'mingw-w64-ucrt-x86_64-pkg-config' }}
|
||||||
|
|
||||||
# - name: Clone and build ssdeep
|
- name: Clone and build ssdeep
|
||||||
# shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
# run: |
|
run: |
|
||||||
# MSYS2_WORKSPACE=$(cygpath -u '${{ github.workspace }}')
|
MSYS2_WORKSPACE=$(cygpath -u '${{ github.workspace }}')
|
||||||
# echo "Converted workspace path: $MSYS2_WORKSPACE"
|
echo "Converted workspace path: $MSYS2_WORKSPACE"
|
||||||
|
|
||||||
# git clone https://github.com/ssdeep-project/ssdeep.git --depth 1
|
git clone https://github.com/ssdeep-project/ssdeep.git --depth 1
|
||||||
# cd ssdeep
|
cd ssdeep
|
||||||
# autoreconf -i
|
autoreconf -i
|
||||||
# ./configure --enable-shared --disable-static CFLAGS="-O3" CXXFLAGS="-O3"
|
|
||||||
# make dll
|
if [ "${{ matrix.arch }}" = "x86" ]; then
|
||||||
|
./configure --enable-shared --disable-static CFLAGS="-O3" CXXFLAGS="-O3" --build=i686-pc-mingw32
|
||||||
|
else
|
||||||
|
./configure --enable-shared --disable-static CFLAGS="-O3" CXXFLAGS="-O3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
make dll
|
||||||
|
|
||||||
# mkdir -p "${MSYS2_WORKSPACE}/ssdeep-install/bin"
|
mkdir -p "${MSYS2_WORKSPACE}/ssdeep-install-${{ matrix.arch }}/bin"
|
||||||
# mkdir -p "${MSYS2_WORKSPACE}/ssdeep-install/include"
|
mkdir -p "${MSYS2_WORKSPACE}/ssdeep-install-${{ matrix.arch }}/include"
|
||||||
# cp -v fuzzy.dll "${MSYS2_WORKSPACE}/ssdeep-install/bin/"
|
cp -v fuzzy.dll "${MSYS2_WORKSPACE}/ssdeep-install-${{ matrix.arch }}/bin/"
|
||||||
# cp -v fuzzy.h "${MSYS2_WORKSPACE}/ssdeep-install/include/"
|
cp -v fuzzy.h "${MSYS2_WORKSPACE}/ssdeep-install-${{ matrix.arch }}/include/"
|
||||||
# cp -v fuzzy.def "${MSYS2_WORKSPACE}/ssdeep-install/"
|
cp -v fuzzy.def "${MSYS2_WORKSPACE}/ssdeep-install-${{ matrix.arch }}/"
|
||||||
|
|
||||||
# - name: Restore vcpkg cache
|
- name: Restore vcpkg cache
|
||||||
# id: vcpkg-cache
|
id: vcpkg-cache
|
||||||
# uses: TAServers/vcpkg-cache@v3
|
uses: TAServers/vcpkg-cache@v3
|
||||||
# with:
|
with:
|
||||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# prefix: vcpkg-iis-module/
|
prefix: vcpkg-iis-module-${{ matrix.arch }}/
|
||||||
|
|
||||||
# - name: Configure CMake for IIS Module
|
- name: Configure CMake for IIS Module
|
||||||
# env:
|
env:
|
||||||
# VCPKG_FEATURE_FLAGS: "binarycaching"
|
VCPKG_FEATURE_FLAGS: "binarycaching"
|
||||||
# VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
|
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
|
||||||
# run: |
|
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows
|
||||||
# cmake `
|
run: |
|
||||||
# -DAPACHE_ROOT="C:\tools\Apache24" `
|
$archFlag = "${{ matrix.arch }}"
|
||||||
# -DSSDEEP_ROOT="${{ github.workspace }}\ssdeep-install" `
|
$cmakeArch = if ($archFlag -eq "x86") { "Win32" } else { "x64" }
|
||||||
# -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install" `
|
|
||||||
# -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" `
|
cmake `
|
||||||
# -DWITH_SSDEEP=ON `
|
-DAPACHE_ROOT="$env:APACHE_ROOT" `
|
||||||
# -DWITH_LUA=ON `
|
-DSSDEEP_ROOT="${{ github.workspace }}\ssdeep-install-${{ matrix.arch }}" `
|
||||||
# -DWITH_YAJL=ON `
|
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\install-${{ matrix.arch }}" `
|
||||||
# -S IIS -B iis\build
|
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" `
|
||||||
|
-A $cmakeArch `
|
||||||
|
-DWITH_SSDEEP=ON `
|
||||||
|
-DWITH_LUA=ON `
|
||||||
|
-DWITH_YAJL=ON `
|
||||||
|
-S IIS -B "iis\build-${{ matrix.arch }}"
|
||||||
|
|
||||||
# - name: Build IIS Module
|
- name: Build IIS Module
|
||||||
# shell: pwsh
|
shell: pwsh
|
||||||
# run: |
|
run: |
|
||||||
# cmake --build iis\build --config Release
|
cmake --build "iis\build-${{ matrix.arch }}" --config Release
|
||||||
|
|
||||||
# - name: Package IIS Module with WiX
|
# - name: Package IIS Module with WiX
|
||||||
# shell: pwsh
|
# shell: pwsh
|
||||||
# run: |
|
# run: |
|
||||||
# $CURRENT_DIR = "${{ github.workspace }}/iis/wix"
|
# $CURRENT_DIR = "${{ github.workspace }}/iis/wix"
|
||||||
# candle.exe -ext WixUtilExtension -ext WixUIExtension "$CURRENT_DIR\installer.wxs" -out "$CURRENT_DIR\installer.wixobj" -arch x64
|
# $arch = "${{ matrix.arch }}"
|
||||||
# light.exe -ext WixUtilExtension -ext WixUIExtension "$CURRENT_DIR\installer.wixobj" -out "$CURRENT_DIR\installer-64.msi"
|
# $wixArch = if ($arch -eq "x86") { "x86" } else { "x64" }
|
||||||
|
# candle.exe -ext WixUtilExtension -ext WixUIExtension "$CURRENT_DIR\installer.wxs" -out "$CURRENT_DIR\installer.wixobj" -arch $wixArch
|
||||||
|
# light.exe -ext WixUtilExtension -ext WixUIExtension "$CURRENT_DIR\installer.wixobj" -out "$CURRENT_DIR\installer-$arch.msi"
|
||||||
Reference in New Issue
Block a user