|
51 | 51 |
|
52 | 52 | steps:
|
53 | 53 | - name: "Checkout"
|
54 |
| - uses: "actions/checkout@v2" |
| 54 | + uses: "actions/checkout@v3" |
55 | 55 | with:
|
56 | 56 | fetch-depth: 2
|
57 | 57 | submodules: true
|
|
78 | 78 | run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test
|
79 | 79 | env:
|
80 | 80 | MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
|
| 81 | + |
| 82 | + windows-tests: |
| 83 | + name: "Windows Tests" |
| 84 | + runs-on: ${{ matrix.os }} |
| 85 | + defaults: |
| 86 | + run: |
| 87 | + shell: cmd |
| 88 | + |
| 89 | + strategy: |
| 90 | + fail-fast: true |
| 91 | + matrix: |
| 92 | + os: [ windows-2019, windows-2022 ] |
| 93 | + php: [ "7.2", "7.3", "8.0", "8.1", "8.2" ] |
| 94 | + arch: [ x64, x86 ] |
| 95 | + ts: [ ts, nts ] |
| 96 | + exclude: |
| 97 | + - { os: windows-2019, php: "8.2" } |
| 98 | + - { os: windows-2019, php: "8.1" } |
| 99 | + - { os: windows-2019, php: "8.0" } |
| 100 | + - { os: windows-2019, php: "7.4" } |
| 101 | + - { os: windows-2019, php: "7.3" } |
| 102 | + - { os: windows-2022, php: "7.2" } |
| 103 | + |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v3 |
| 106 | + with: |
| 107 | + fetch-depth: 2 |
| 108 | + submodules: true |
| 109 | + |
| 110 | + - name: Setup PHP SDK |
| 111 | + id: setup-php |
| 112 | + |
| 113 | + with: |
| 114 | + version: ${{ matrix.php }} |
| 115 | + arch: ${{ matrix.arch }} |
| 116 | + ts: ${{ matrix.ts }} |
| 117 | + deps: openssl |
| 118 | + |
| 119 | + - name: Enable Developer Command Prompt |
| 120 | + uses: ilammy/msvc-dev-cmd@v1 |
| 121 | + with: |
| 122 | + arch: ${{ matrix.arch }} |
| 123 | + toolset: ${{ steps.setup-php.outputs.toolset }} |
| 124 | + |
| 125 | + - name: phpize |
| 126 | + run: phpize |
| 127 | + |
| 128 | + - name: configure |
| 129 | + run: configure --enable-mongodb --with-mongodb-sasl=yes --with-mongodb-client-side-encryption=yes --enable-debug-pack --with-prefix=${{ steps.setup-php.outputs.prefix }} |
| 130 | + |
| 131 | + - name: nmake |
| 132 | + run: nmake /nologo |
| 133 | + |
| 134 | + - name: Start MongoDB |
| 135 | + run: | |
| 136 | + sc config MongoDB start= auto |
| 137 | + sc start MongoDB |
| 138 | +
|
| 139 | + - name: Wait until MongoDB is available |
| 140 | + run: .github/workflows/wait-for-mongodb.bat |
| 141 | + |
| 142 | + - name: Run Tests |
| 143 | + run: nmake /nologo test |
| 144 | + env: |
| 145 | + NO_INTERACTION: 1 |
| 146 | + REPORT_EXIT_STATUS: 1 |
| 147 | + TESTS: --show-diff |
| 148 | + |
| 149 | + - name: Copy DLL and PDB files to CWD |
| 150 | + if: ${{ github.event_name == 'push' }} |
| 151 | + run: | |
| 152 | + cp .github/workflows/get-build-dir.bat . |
| 153 | + for /F "usebackq tokens=*" %%i in (`get-build-dir.bat`) do set BUILD_DIR=%%i |
| 154 | + echo BUILD_DIR=%BUILD_DIR% |
| 155 | + cp %BUILD_DIR%\php_mongodb.dll . |
| 156 | + cp %BUILD_DIR%\php_mongodb.pdb . |
| 157 | +
|
| 158 | + - name: Upload DLL and PDB files as build artifacts |
| 159 | + if: ${{ github.event_name == 'push' }} |
| 160 | + uses: actions/upload-artifact@v3 |
| 161 | + with: |
| 162 | + name: php_mongodb-${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} |
| 163 | + path: | |
| 164 | + php_mongodb.dll |
| 165 | + php_mongodb.pdb |
| 166 | + retention-days: 3 |
0 commit comments