Skip to content

Commit

Permalink
Windows ci fix (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Feb 24, 2023
1 parent 8c66121 commit e361f03
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,24 @@ jobs:
make
./dev-scripts/run_tests
# linux-arm:
# name: ARM (${{ matrix.arch }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# arch: [armv6, armv7, arm64]
# steps:
# - name: Build ${{ env.PACKAGE_NAME }}
# run: |
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
# linux-arm:
# name: ARM (${{ matrix.arch }})
# runs-on: ubuntu-latest
# strategy:
# matrix:
# arch: [armv6, armv7, arm64]
# steps:
# - name: Build ${{ env.PACKAGE_NAME }}
# run: |
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream

windows-vc16:
runs-on: windows-2019
defaults:
run:
shell: cmd # use CMD instead of powershell to catch error from bat script
strategy:
matrix:
arch: [x64]
Expand All @@ -115,13 +118,12 @@ jobs:
with:
arch: ${{ matrix.arch }}
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
phpize
.\configure --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} --enable-awscrt=shared --enable-cli --enable-openssl
nmake
nmake generate-php-ini
.\dev-scripts\run_tests ${{steps.setup-php-sdk.outputs.prefix}}\php
# CMD only execute one commend per run
- run: phpize
- run: .\configure --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} --enable-awscrt=shared --enable-cli --enable-openssl
- run: nmake
- run: nmake generate-php-ini
- run: .\dev-scripts\run_tests ${{steps.setup-php-sdk.outputs.prefix}}\php

# windows-vc14:
# runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions Makefile.frag.w32
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ $(AWSCRT_DIR)\ext\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h
# Get the dll directory to load
generate-php-ini:
@echo extension=$(BUILD_DIR)\php_awscrt.dll > php-win.ini
@echo extension=$(PHP_PREFIX)\ext\php_openssl.dll >> php-win.ini
@echo extension=$(PHP_PREFIX)\ext\php_mbstring.dll >> php-win.ini
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"minimum-stability": "alpha",
"require": {
"php": ">=5.5",
"ext-awscrt": "*"
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit":"^5.6.3"
Expand Down
1 change: 0 additions & 1 deletion dev-scripts/run_tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if not "%~1"=="" (
set "PHP_BINARY=%~1"
)


REM Check if composer_dir was found
if "%composer_dir%"=="" (
echo No composer found.
Expand Down
2 changes: 1 addition & 1 deletion php-win.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
extension_dir="ext"
extension=php_awscrt.dll
extension=php_openssl.dll
extension=php_mbstring.dll

0 comments on commit e361f03

Please sign in to comment.