Skip to content

Commit 2fdf2c8

Browse files
committed
chore: test php 8.5 vc version
1 parent 62c4310 commit 2fdf2c8

1 file changed

Lines changed: 135 additions & 121 deletions

File tree

.github/workflows/ci.yml

Lines changed: 135 additions & 121 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,133 +15,119 @@ 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:
84+
fail-fast: false
8485
matrix:
8586
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" ]
87+
php-version: [ "8.3", "8.5" ]
88+
target: [ x86_64-pc-windows-msvc ]
89+
phpts: [ "ts" ]
8990
include:
9091
- { rust_channel: stable }
9192
- { target: x86_64-pc-windows-msvc, rust_channel: nightly }
9293
- { 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 }
10294

10395
steps:
10496
- name: Checkout
10597
uses: actions/checkout@v4
10698
with:
10799
submodules: recursive
108100

109-
- name: Cache cargo and LLVM and Clang
110-
id: cache-llvm
111-
uses: actions/cache@v4
112-
with:
113-
path: |
114-
~/.cargo/bin/
115-
~/.cargo/registry/index/
116-
~/.cargo/registry/cache/
117-
~/.cargo/git/db/
118-
target/
119-
${{ runner.temp }}/llvm-${{ matrix.clang }}
120-
key: ${{ matrix.php-version }}-test
121-
122-
- name: Setup LLVM & Clang
123-
id: clang
124-
if: runner.os == 'Linux'
125-
uses: KyleMayes/install-llvm-action@v2
101+
- name: Install Rust toolchain
102+
uses: dtolnay/rust-toolchain@master
126103
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
104+
toolchain: ${{ matrix.rust_channel }}
105+
targets: ${{ matrix.target }}
106+
107+
# - name: Setup LLVM & Clang
108+
# id: clang
109+
# if: runner.os == 'Linux'
110+
# uses: KyleMayes/install-llvm-action@v2
111+
# with:
112+
# version: ${{ matrix.clang }}
113+
# directory: ${{ runner.temp }}/llvm-${{ matrix.clang }}
114+
# cached: ${{ steps.cache-llvm.outputs.cache-hit }}
115+
116+
# - name: Configure Clang
117+
# if: runner.os == 'Linux'
118+
# run: |
119+
# echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/lib" >> $GITHUB_ENV
120+
# echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
121+
# echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ matrix.clang }}/bin/llvm-config" >> $GITHUB_ENV
137122

138123
- name: Install latest Rust toolchain
139-
run: |
140-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
141-
#source $HOME/.cargo/env
142-
rustup default ${{ matrix.rust_channel }}
143-
rustup target add ${{ matrix.target }}
144-
shell: bash
124+
- name: Cache cargo and build artifacts
125+
uses: Swatinem/rust-cache@v2
126+
with:
127+
key: ${{ matrix.php-version }}-${{ matrix.phpts }}
128+
# TODO: remove this line once php8ts.dll linking is confirmed.
129+
# While debugging the TS/NTS link issue, don't restore a stale target/.
130+
cache-targets: false
145131

146132
- name: Setup PHP with PECL extension
147133
uses: shivammathur/setup-php@v2
@@ -151,18 +137,27 @@ jobs:
151137
env:
152138
phpts: ${{ matrix.phpts }}
153139

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

167162
- name: OS Specific Configuration - Windows
168163
if: runner.os == 'Windows'
@@ -171,9 +166,28 @@ jobs:
171166
echo "LIB_EXT=dll" >> $GITHUB_ENV
172167
shell: bash
173168

169+
- name: Record toolchain versions
170+
if: runner.os == 'Windows'
171+
run: |
172+
rustc -Vv
173+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productDisplayVersion
174+
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationVersion
175+
shell: pwsh
176+
177+
- name: Show what the build sees
178+
if: runner.os == 'Windows'
179+
run: |
180+
echo "PATH php:"; where php
181+
echo "PHP env: $PHP"
182+
echo "PHP_CONFIG env: $PHP_CONFIG"
183+
echo "PHP_LIB env: $PHP_LIB"
184+
echo "RUST_PHP_* :"; env | grep -i php
185+
php -i | findstr /i "Thread Safety Build Directory"
186+
shell: bash
187+
174188
- name: Build module
175189
run: |
176-
cargo build --release --target ${{ matrix.target }} --lib
190+
cargo build --release --target ${{ matrix.target }} --lib -vv
177191
178192
- name: Rename file
179193
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)