0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 18:41:52 +00:00
phpv8/.github/workflows/build-test.yml

92 lines
3.1 KiB
YAML
Raw Normal View History

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
2024-09-28 02:22:51 +00:00
- name: Restore cache v8 ${{ matrix.v8-versions }} build
id: v8-build-cache
uses: actions/cache/restore@v4
with:
path: /opt/v8/self-built
key: ${{ runner.os }}-${{ matrix.v8-versions }}-v8-build
- name: Setup Google depot tools
2024-09-28 02:22:51 +00:00
# only needed, when v8 needs to be built
if: steps.v8-build-cache.outputs.cache-hit != 'true'
uses: newkdev/setup-depot-tools@v1.0.1
- name: Build v8 ${{ matrix.v8-versions }}
2024-09-28 02:22:51 +00:00
if: steps.v8-build-cache.outputs.cache-hit != 'true'
run: |
# Store extra tools somewhere undisturbing
cd "$(mktemp -d)"
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}"
2024-09-28 02:22:51 +00:00
- name: Save v8 ${{ matrix.v8-versions }} build cache
if: steps.v8-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: /opt/v8/self-built
key: ${{ steps.v8-build-cache.outputs.cache-primary-key }}
- name: Build extension
run: |
phpize
./configure --with-v8js=/opt/v8/self-built LDFLAGS="-lstdc++" CPPFLAGS="-DV8_COMPRESS_POINTERS -DV8_ENABLE_SANDBOX"
make
make test