|
1 | 1 | name: Windows |
2 | | - |
3 | 2 | on: |
| 3 | + release: |
| 4 | + types: [published] |
4 | 5 | pull_request: null |
5 | 6 | push: |
6 | 7 | branches: |
|
10 | 11 | schedule: |
11 | 12 | - cron: "30 4 * * *" |
12 | 13 |
|
| 14 | +permissions: |
| 15 | + contents: write |
| 16 | + |
13 | 17 | jobs: |
| 18 | + get-extension-matrix: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + outputs: |
| 21 | + matrix: ${{ steps.extension-matrix.outputs.matrix }} |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: Get the extension matrix |
| 26 | + id: extension-matrix |
| 27 | + uses: php/php-windows-builder/extension-matrix@c89baa7d20ae73f2a022556132c3d6f4b56a89b8 #v1.5.1 |
| 28 | + with: |
| 29 | + php-version-list: '8.0, 8.1, 8.2, 8.3, 8.4, 8.5' |
| 30 | + arch-list: 'x64, x86' |
| 31 | + ts-list: 'ts' |
14 | 32 | build: |
15 | | - defaults: |
16 | | - run: |
17 | | - shell: cmd |
| 33 | + needs: get-extension-matrix |
| 34 | + runs-on: ${{ matrix.os }} |
18 | 35 | strategy: |
19 | | - matrix: |
20 | | - version: ["8.0", "8.1", "8.2", "8.3", "8.4"] |
21 | | - arch: [x64] |
22 | | - ts: [ts] |
23 | | - if: success() || failure() |
24 | | - runs-on: windows-2022 |
25 | | - name: Windows, PHP v${{matrix.version}} |
| 36 | + matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}} |
26 | 37 | steps: |
27 | 38 | - name: Checkout |
28 | 39 | uses: actions/checkout@v4 |
29 | | - - name: Setup PHP |
30 | | - id: setup-php |
31 | | - uses: php/setup-php-sdk@v0.11 |
| 40 | + - name: Build the extension |
| 41 | + uses: php/php-windows-builder/extension@c89baa7d20ae73f2a022556132c3d6f4b56a89b8 #v1.5.1 |
32 | 42 | with: |
33 | | - version: ${{matrix.version}} |
34 | | - arch: ${{matrix.arch}} |
35 | | - ts: ${{matrix.ts}} |
36 | | - cache: true |
37 | | - - name: Fetch dependencies |
38 | | - run: | |
39 | | - curl -LO https://downloads.php.net/~windows/pecl/deps/pthreads-3.0.0-vs16-${{matrix.arch}}.zip |
40 | | - 7z x pthreads-3.0.0-vs16-${{matrix.arch}}.zip -o..\deps |
41 | | - - name: Enable Developer Command Prompt |
42 | | - uses: ilammy/msvc-dev-cmd@v1 |
43 | | - with: |
44 | | - arch: ${{matrix.arch}} |
45 | | - toolset: ${{steps.setup-php.outputs.toolset}} |
46 | | - - name: phpize |
47 | | - run: phpize |
48 | | - - name: configure |
49 | | - run: configure --with-parallel --enable-debug-pack --with-prefix=${{steps.setup-php.outputs.prefix}} |
50 | | - - name: make |
51 | | - run: nmake |
52 | | - - name: test |
53 | | - run: nmake test TESTS="--show-diff tests" |
54 | | - - name: package |
55 | | - run: | |
56 | | - md win-install |
57 | | - copy LICENSE win-install |
58 | | - copy README.md win-install |
59 | | - if exist x64 ( |
60 | | - if exist x64\Release (set prefix=x64\Release) else set prefix=x64\Release_TS |
61 | | - ) else ( |
62 | | - if exist Release (set prefix=Release) else set prefix=Release_TS |
63 | | - ) |
64 | | - copy %prefix%\php_parallel.dll win-install |
65 | | - copy %prefix%\php_parallel.pdb win-install |
66 | | - copy ..\deps\COPYING win-install\COPYING.PTHREADS |
67 | | - copy ..\deps\bin\* win-install |
68 | | - - name: Upload artifacts |
69 | | - uses: actions/upload-artifact@v4 |
| 43 | + php-version: ${{ matrix.php-version }} |
| 44 | + arch: ${{ matrix.arch }} |
| 45 | + ts: ${{ matrix.ts }} |
| 46 | + args: --with-parallel |
| 47 | + libs: pthreads |
| 48 | + run-tests: true |
| 49 | + test-runner-args: -d opcache.jit=0 --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP |
| 50 | + test-opcache-mode: both |
| 51 | + release: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: build |
| 54 | + if: ${{ github.event_name == 'release' }} |
| 55 | + steps: |
| 56 | + - name: Upload artifact to the release |
| 57 | + uses: php/php-windows-builder/release@c89baa7d20ae73f2a022556132c3d6f4b56a89b8 #v1.5.1 |
70 | 58 | with: |
71 | | - name: parallel-${{matrix.version}} |
72 | | - path: win-install |
| 59 | + release: ${{ github.event.release.tag_name }} |
| 60 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments