Skip to content

Commit 0bf2d95

Browse files
committed
chore: test php 8.5 vc version
1 parent 62c4310 commit 0bf2d95

1 file changed

Lines changed: 122 additions & 103 deletions

File tree

.github/workflows/ci.yml

Lines changed: 122 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
push:
66
paths-ignore:
77
- '**.md'
8-
- '**.yaml'
9-
- '**.yml'
8+
# - '**.yaml'
9+
# - '**.yml'
1010

1111
permissions:
1212
contents: write
@@ -15,90 +15,81 @@ env:
1515
EXTENSION_NAME: fluent
1616

1717
jobs:
18-
tests:
19-
runs-on: ubuntu-22.04
20-
strategy:
21-
matrix:
22-
php-version: [ "8.5" ]
23-
clang: [ "16" ]
24-
target: [ "x86_64-unknown-linux-gnu" ]
25-
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
with:
30-
submodules: recursive
31-
32-
- name: Cache cargo and LLVM and Clang
33-
id: cache-llvm
34-
uses: actions/cache@v4
35-
with:
36-
path: |
37-
~/.cargo/bin/
38-
~/.cargo/registry/index/
39-
~/.cargo/registry/cache/
40-
~/.cargo/git/db/
41-
target/
42-
${{ runner.temp }}/llvm-${{ matrix.clang }}
43-
key: ${{ matrix.php-version }}-test
44-
45-
- name: Setup LLVM & Clang
46-
id: clang
47-
if: runner.os == 'Linux'
48-
uses: KyleMayes/install-llvm-action@v2
49-
with:
50-
version: ${{ matrix.clang }}
51-
directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
52-
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
53-
54-
- name: Configure Clang
55-
run: |
56-
echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
57-
echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
58-
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
59-
60-
- uses: shivammathur/setup-php@v2
61-
with:
62-
php-version: ${{ matrix.php-version }}
63-
tools: php-config
64-
65-
- name: Install latest Rust toolchain
66-
run: |
67-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
68-
source $HOME/.cargo/env
69-
rustup default stable
70-
rustup target add ${{ matrix.target }}
71-
72-
- name: Build module
73-
run: |
74-
cargo build --target ${{ matrix.target }} --lib
75-
cargo test --target ${{ matrix.target }}
76-
77-
- name: Run PHP Test
78-
run: NO_INTERACTION=1 php run-tests.php -n -d extension=target/${{ matrix.target }}/debug/libfluent.so
18+
# tests:
19+
# runs-on: ubuntu-22.04
20+
# strategy:
21+
# matrix:
22+
# php-version: [ "8.5" ]
23+
# clang: [ "16" ]
24+
# target: [ "x86_64-unknown-linux-gnu" ]
25+
26+
# steps:
27+
# - name: Checkout
28+
# uses: actions/checkout@v4
29+
# with:
30+
# submodules: recursive
31+
32+
# - name: Cache cargo and LLVM and Clang
33+
# id: cache-llvm
34+
# uses: actions/cache@v4
35+
# with:
36+
# path: |
37+
# ~/.cargo/bin/
38+
# ~/.cargo/registry/index/
39+
# ~/.cargo/registry/cache/
40+
# ~/.cargo/git/db/
41+
# target/
42+
# ${{ runner.temp }}/llvm-${{ matrix.clang }}
43+
# key: ${{ matrix.php-version }}-test
44+
45+
# - name: Setup LLVM & Clang
46+
# id: clang
47+
# if: runner.os == 'Linux'
48+
# uses: KyleMayes/install-llvm-action@v2
49+
# with:
50+
# version: ${{ matrix.clang }}
51+
# directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
52+
# cached: ${{ steps.cache-llvm.outputs.cache-hit }}
53+
54+
# - name: Configure Clang
55+
# run: |
56+
# echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
57+
# echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
58+
# echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
59+
60+
# - uses: shivammathur/setup-php@v2
61+
# with:
62+
# php-version: ${{ matrix.php-version }}
63+
# tools: php-config
64+
65+
# - name: Install latest Rust toolchain
66+
# run: |
67+
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
68+
# source $HOME/.cargo/env
69+
# rustup default stable
70+
# rustup target add ${{ matrix.target }}
71+
72+
# - name: Build module
73+
# run: |
74+
# cargo build --target ${{ matrix.target }} --lib
75+
# cargo test --target ${{ matrix.target }}
76+
77+
# - name: Run PHP Test
78+
# run: NO_INTERACTION=1 php run-tests.php -n -d extension=target/${{ matrix.target }}/debug/libfluent.so
7979

8080
build:
8181
runs-on: ${{ matrix.os }}
82-
needs: tests
82+
# needs: tests
8383
strategy:
8484
matrix:
8585
clang: [ "16" ]
86-
php-version: [ "8.2", "8.3", "8.4", "8.5" ]
87-
target: [ x86_64-pc-windows-msvc, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu ]
88-
phpts: [ "nts", "ts" ]
86+
php-version: [ "8.3", "8.5" ]
87+
target: [ x86_64-pc-windows-msvc ]
88+
phpts: [ "ts" ]
8989
include:
9090
- { rust_channel: stable }
9191
- { target: x86_64-pc-windows-msvc, rust_channel: nightly }
9292
- { target: x86_64-pc-windows-msvc, os: windows-latest }
93-
- { target: aarch64-apple-darwin, os: macos-latest }
94-
- { target: x86_64-apple-darwin, os: macos-latest }
95-
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
96-
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04 }
97-
exclude:
98-
- { target: aarch64-apple-darwin, phpts: ts }
99-
- { target: x86_64-apple-darwin, phpts: ts }
100-
- { target: x86_64-unknown-linux-gnu, phpts: ts }
101-
- { target: aarch64-unknown-linux-gnu, phpts: ts }
10293

10394
steps:
10495
- name: Checkout
@@ -119,21 +110,21 @@ jobs:
119110
${{ runner.temp }}/llvm-${{ matrix.clang }}
120111
key: ${{ matrix.php-version }}-test
121112

122-
- name: Setup LLVM & Clang
123-
id: clang
124-
if: runner.os == 'Linux'
125-
uses: KyleMayes/install-llvm-action@v2
126-
with:
127-
version: ${{ matrix.clang }}
128-
directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
129-
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
130-
131-
- name: Configure Clang
132-
if: runner.os == 'Linux'
133-
run: |
134-
echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
135-
echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
136-
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
113+
# - name: Setup LLVM & Clang
114+
# id: clang
115+
# if: runner.os == 'Linux'
116+
# uses: KyleMayes/install-llvm-action@v2
117+
# with:
118+
# version: ${{ matrix.clang }}
119+
# directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
120+
# cached: ${{ steps.cache-llvm.outputs.cache-hit }}
121+
122+
# - name: Configure Clang
123+
# if: runner.os == 'Linux'
124+
# run: |
125+
# echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
126+
# echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
127+
# echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
137128

138129
- name: Install latest Rust toolchain
139130
run: |
@@ -151,18 +142,27 @@ jobs:
151142
env:
152143
phpts: ${{ matrix.phpts }}
153144

154-
- name: OS Specific Configuration - Linux
155-
if: runner.os == 'Linux'
156-
run: |
157-
echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.so" >> $GITHUB_ENV
158-
echo "LIB_EXT=so" >> $GITHUB_ENV
159-
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross musl-tools musl-dev
160-
161-
- name: OS Specific Configuration - macOS
162-
if: runner.os == 'macOS'
145+
- name: Assert PHP thread safety matches request
146+
if: runner.os == 'Windows'
163147
run: |
164-
echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.dylib" >> $GITHUB_ENV
165-
echo "LIB_EXT=so" >> $GITHUB_ENV
148+
php -r "echo PHP_ZTS ? 'TS' : 'NTS';" > ts.txt
149+
set /p ACTUAL=<ts.txt
150+
echo Requested=${{ matrix.phpts }} Actual=%ACTUAL%
151+
if /i "%ACTUAL%"=="NTS" if /i "${{ matrix.phpts }}"=="ts" exit /b 1
152+
shell: cmd
153+
154+
# - name: OS Specific Configuration - Linux
155+
# if: runner.os == 'Linux'
156+
# run: |
157+
# echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.so" >> $GITHUB_ENV
158+
# echo "LIB_EXT=so" >> $GITHUB_ENV
159+
# sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross musl-tools musl-dev
160+
161+
# - name: OS Specific Configuration - macOS
162+
# if: runner.os == 'macOS'
163+
# run: |
164+
# echo "OUTPUT_FILE=lib${{ env.EXTENSION_NAME }}.dylib" >> $GITHUB_ENV
165+
# echo "LIB_EXT=so" >> $GITHUB_ENV
166166

167167
- name: OS Specific Configuration - Windows
168168
if: runner.os == 'Windows'
@@ -171,9 +171,28 @@ jobs:
171171
echo "LIB_EXT=dll" >> $GITHUB_ENV
172172
shell: bash
173173

174+
- name: Record toolchain versions
175+
if: runner.os == 'Windows'
176+
run: |
177+
rustc -Vv
178+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productDisplayVersion
179+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationVersion
180+
shell: pwsh
181+
182+
- name: Show what the build sees
183+
if: runner.os == 'Windows'
184+
run: |
185+
echo "PATH php:"; where php
186+
echo "PHP env: $PHP"
187+
echo "PHP_CONFIG env: $PHP_CONFIG"
188+
echo "PHP_LIB env: $PHP_LIB"
189+
echo "RUST_PHP_* :"; env | grep -i php
190+
php -i | findstr /i "Thread Safety Build Directory"
191+
shell: bash
192+
174193
- name: Build module
175194
run: |
176-
cargo build --release --target ${{ matrix.target }} --lib
195+
cargo build --release --target ${{ matrix.target }} --lib -vv
177196
178197
- name: Rename file
179198
run: mv target/${{ matrix.target }}/release/${{ env.OUTPUT_FILE }} target/php${{ matrix.php-version }}-${{ matrix.phpts }}-${{ matrix.target }}-${{ env.EXTENSION_NAME }}.${{ env.LIB_EXT }}

0 commit comments

Comments
 (0)