0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 09:21:52 +00:00

Add github workflow to test building and testing the extension

This commit is contained in:
Joshua Behrens 2024-09-28 02:23:23 +02:00
parent 73e684f4a8
commit aef80cd1c1
No known key found for this signature in database
GPG Key ID: DD28BD85EE8F67DD

74
.github/workflows/build-test.yml vendored Normal file
View File

@ -0,0 +1,74 @@
name: Test building extension
on:
- push
permissions:
contents: read
jobs:
build:
strategy:
matrix:
operating-system:
- ubuntu-latest
# - windows-latest
# - macos-latest
php-versions:
# - '8.1'
# - '8.2'
- '8.3'
# - '8.4'
v8-versions:
- 10.9.194
# - 11.9.172
- 12.9.203
# - 13.1.104
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Build v8 ${{ matrix.v8-versions }}
run: |
# Store extra tools somewhere undisturbing
cd "$(mktemp -d)"
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
cd v8
git checkout ${{ matrix.v8-versions }}
gclient sync -D
# Setup GN
# Warnings are no errors - @see https://issues.chromium.org/issues/42203398#comment9
tools/dev/v8gen.py -vv x64.release -- is_component_build=true use_custom_libcxx=false treat_warnings_as_errors=false
# Build
ninja -C out.gn/x64.release/
# Install to /opt/v8/self-built
sudo mkdir -p /opt/v8/self-built/{lib,include}
sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin out.gn/x64.release/icudtl.dat /opt/v8/self-built/lib/
sudo cp -R include/* /opt/v8/self-built/include/
# Go back to origin
cd "${GITHUB_WORKSPACE}"
- name: Build extension
run: |
phpize
./configure --with-v8js=/opt/v8/self-built LDFLAGS="-lstdc++" CPPFLAGS="-DV8_COMPRESS_POINTERS -DV8_ENABLE_SANDBOX"
make
make test