Files
ModSecurity/.github/workflows/test-ci-windows.yml
A13501350 84425206e8 test 3
2025-09-19 03:58:12 +08:00

62 lines
1.8 KiB
YAML

name: CI/CD for IIS Module
on:
push:
branches:
- v2/test-ci-windows
pull_request:
branches:
- v2/test-ci-windows
jobs:
build:
runs-on: windows-latest
steps:
- name: Create test files (MSYS2)
uses: msys2/setup-msys2@v2
shell: msys2 {0}
run: |
# 创建测试目录和文件
mkdir -p test-files
echo "This is a test file" > test-files/test.txt
echo "fuzzy definition file" > test-files/fuzzy.def
# 复制到工作区目录
mkdir -p ${{ github.workspace }}/artifacts
cp -r test-files/* ${{ github.workspace }}/artifacts/
# 验证文件已复制
echo "Files in artifacts directory:"
ls -la ${{ github.workspace }}/artifacts/
- name: Verify file transfer (PowerShell)
shell: powershell
run: |
Write-Host "Checking transferred files in PowerShell:"
Get-ChildItem -Path "${{ github.workspace }}\artifacts" -Recurse
# 验证文件内容
Write-Host "Content of test.txt:"
Get-Content "${{ github.workspace }}\artifacts\test.txt"
Write-Host "Content of fuzzy.def:"
Get-Content "${{ github.workspace }}\artifacts\fuzzy.def"
# 检查文件是否存在
$testFile = "${{ github.workspace }}\artifacts\test.txt"
$fuzzyFile = "${{ github.workspace }}\artifacts\fuzzy.def"
if (Test-Path $testFile -PathType Leaf) {
Write-Host "✓ test.txt successfully transferred"
} else {
Write-Host "✗ test.txt not found"
exit 1
}
if (Test-Path $fuzzyFile -PathType Leaf) {
Write-Host "✓ fuzzy.def successfully transferred"
} else {
Write-Host "✗ fuzzy.def not found"
exit 1
}