|
| 1 | +name: Test building extension |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + operating-system: |
| 14 | + - ubuntu-latest |
| 15 | +# - windows-latest |
| 16 | +# - macos-latest |
| 17 | + php-versions: |
| 18 | +# - '8.1' |
| 19 | +# - '8.2' |
| 20 | + - '8.3' |
| 21 | +# - '8.4' |
| 22 | + v8-versions: |
| 23 | + - 10.9.194 |
| 24 | +# - 11.9.172 |
| 25 | + - 12.9.203 |
| 26 | +# - 13.1.104 |
| 27 | + |
| 28 | + runs-on: ${{ matrix.operating-system }} |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v2 |
| 33 | + |
| 34 | + - name: Setup PHP |
| 35 | + uses: shivammathur/setup-php@v2 |
| 36 | + with: |
| 37 | + php-version: ${{ matrix.php-versions }} |
| 38 | + coverage: none |
| 39 | + |
| 40 | + - name: Build v8 ${{ matrix.v8-versions }} |
| 41 | + run: | |
| 42 | + # Store extra tools somewhere undisturbing |
| 43 | + cd "$(mktemp -d)" |
| 44 | + |
| 45 | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 46 | + export PATH=`pwd`/depot_tools:"$PATH" |
| 47 | + |
| 48 | + fetch v8 |
| 49 | + cd v8 |
| 50 | + |
| 51 | + git checkout ${{ matrix.v8-versions }} |
| 52 | + gclient sync -D |
| 53 | + |
| 54 | + # Setup GN |
| 55 | + # Warnings are no errors - @see https://issues.chromium.org/issues/42203398#comment9 |
| 56 | + tools/dev/v8gen.py -vv x64.release -- is_component_build=true use_custom_libcxx=false treat_warnings_as_errors=false |
| 57 | + |
| 58 | + # Build |
| 59 | + ninja -C out.gn/x64.release/ |
| 60 | + |
| 61 | + # Install to /opt/v8/self-built |
| 62 | + sudo mkdir -p /opt/v8/self-built/{lib,include} |
| 63 | + 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/ |
| 64 | + sudo cp -R include/* /opt/v8/self-built/include/ |
| 65 | + |
| 66 | + # Go back to origin |
| 67 | + cd "${GITHUB_WORKSPACE}" |
| 68 | + |
| 69 | + - name: Build extension |
| 70 | + run: | |
| 71 | + phpize |
| 72 | + ./configure --with-v8js=/opt/v8/self-built LDFLAGS="-lstdc++" CPPFLAGS="-DV8_COMPRESS_POINTERS -DV8_ENABLE_SANDBOX" |
| 73 | + make |
| 74 | + make test |
0 commit comments