Skip to content

Commit 266b1ca

Browse files
committed
add windows tests and build
1 parent bdae875 commit 266b1ca

File tree

2 files changed

+46
-21
lines changed

2 files changed

+46
-21
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,20 @@ jobs:
106106
cd ..
107107
shell: bash
108108

109-
- name: Verify submodule files
109+
- name: Copy lib files to root for Windows build
110110
run: |
111-
echo "Checking if lib directory and files exist:"
112-
dir lib\
113-
echo "Checking specific source files:"
114-
if (Test-Path "lib\arena.c") { echo "arena.c exists" } else { echo "arena.c missing" }
115-
if (Test-Path "lib\csv_config.c") { echo "csv_config.c exists" } else { echo "csv_config.c missing" }
116-
if (Test-Path "lib\csv_reader.c") { echo "csv_reader.c exists" } else { echo "csv_reader.c missing" }
117-
if (Test-Path "lib\csv_writer.c") { echo "csv_writer.c exists" } else { echo "csv_writer.c missing" }
118-
if (Test-Path "lib\csv_parser.c") { echo "csv_parser.c exists" } else { echo "csv_parser.c missing" }
119-
if (Test-Path "lib\csv_utils.c") { echo "csv_utils.c exists" } else { echo "csv_utils.c missing" }
111+
echo "=== Copying lib files to root directory ==="
112+
if (Test-Path "lib") {
113+
echo "lib directory found, copying files..."
114+
Copy-Item -Path "lib\*.c" -Destination "." -Force
115+
Copy-Item -Path "lib\*.h" -Destination "." -Force
116+
echo "Files copied. Root directory now contains:"
117+
dir *.c
118+
dir *.h
119+
} else {
120+
echo "ERROR: lib directory not found!"
121+
exit 1
122+
}
120123
121124
- name: Build and test extension (PHP 8.4 NTS x64)
122125
uses: php/php-windows-builder/extension@v1
@@ -169,17 +172,20 @@ jobs:
169172
cd ..
170173
shell: bash
171174

172-
- name: Verify submodule files
175+
- name: Copy lib files to root for Windows build
173176
run: |
174-
echo "Checking if lib directory and files exist:"
175-
dir lib\
176-
echo "Checking specific source files:"
177-
if (Test-Path "lib\arena.c") { echo "arena.c exists" } else { echo "arena.c missing" }
178-
if (Test-Path "lib\csv_config.c") { echo "csv_config.c exists" } else { echo "csv_config.c missing" }
179-
if (Test-Path "lib\csv_reader.c") { echo "csv_reader.c exists" } else { echo "csv_reader.c missing" }
180-
if (Test-Path "lib\csv_writer.c") { echo "csv_writer.c exists" } else { echo "csv_writer.c missing" }
181-
if (Test-Path "lib\csv_parser.c") { echo "csv_parser.c exists" } else { echo "csv_parser.c missing" }
182-
if (Test-Path "lib\csv_utils.c") { echo "csv_utils.c exists" } else { echo "csv_utils.c missing" }
177+
echo "=== Copying lib files to root directory ==="
178+
if (Test-Path "lib") {
179+
echo "lib directory found, copying files..."
180+
Copy-Item -Path "lib\*.c" -Destination "." -Force
181+
Copy-Item -Path "lib\*.h" -Destination "." -Force
182+
echo "Files copied. Root directory now contains:"
183+
dir *.c
184+
dir *.h
185+
} else {
186+
echo "ERROR: lib directory not found!"
187+
exit 1
188+
}
183189
184190
- name: Build and test extension
185191
uses: php/php-windows-builder/extension@v1

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,38 @@ jobs:
222222
dir *.h -ErrorAction SilentlyContinue
223223
shell: powershell
224224

225+
- name: Copy lib files to root for Windows build
226+
run: |
227+
echo "=== Copying lib files to root directory ==="
228+
if (Test-Path "lib") {
229+
echo "lib directory found, copying files..."
230+
Copy-Item -Path "lib\*.c" -Destination "." -Force
231+
Copy-Item -Path "lib\*.h" -Destination "." -Force
232+
echo "Files copied. Root directory now contains:"
233+
dir *.c
234+
dir *.h
235+
} else {
236+
echo "ERROR: lib directory not found!"
237+
exit 1
238+
}
239+
shell: powershell
240+
225241
- name: Build the extension
226242
uses: php/php-windows-builder/extension@v1
227243
with:
228244
php-version: ${{ matrix.php-version }}
229245
arch: ${{ matrix.arch == 'x86_64' && 'x64' || matrix.arch }}
230246
ts: ${{ matrix.ts }}
231-
247+
232248
- name: Debug - Check build output
233249
run: |
234250
echo "=== Build output directory ==="
235251
dir -Recurse -Filter "*.dll" -ErrorAction SilentlyContinue
236252
echo "=== Current directory after build ==="
237253
dir
254+
echo "=== Check if lib directory exists after build ==="
255+
if (Test-Path "lib") { echo "lib directory exists"; dir lib } else { echo "lib directory missing after build" }
256+
if (Test-Path "lib-backup") { echo "lib-backup directory exists"; dir lib-backup } else { echo "lib-backup directory missing" }
238257
shell: powershell
239258
- name: Create dist directory
240259
run: mkdir -p dist/releases/${{ github.ref_name }}/windows/php${{ matrix.php-version }}-${{ matrix.arch }}-${{ matrix.ts }}

0 commit comments

Comments
 (0)