• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: PHP extension
2
3on:
4  - push
5  - pull_request
6
7jobs:
8  build-php:
9    name: Build PHP extension
10    runs-on: ubuntu-latest
11    container: ${{ matrix.php-image }}
12    strategy:
13      matrix:
14        php-image:
15          - php:7.4-cli
16          - php:8.1-cli
17    steps:
18      - name: Install python3
19        run: |
20          apt-get update -q
21          apt-get install -qy python3
22      - name: Install bazel
23        run: |
24          apt-get install -qy wget
25          mkdir $HOME/bin
26          wget -O $HOME/bin/bazel https://github.com/bazelbuild/bazel/releases/download/5.3.2/bazel-5.3.2-linux-x86_64
27          chmod a+x $HOME/bin/bazel
28      - name: Install git
29        run: |
30          apt-get update -q
31          apt-get install -qy --no-install-recommends git
32      - name: Checkout
33        uses: actions/checkout@v3
34        with:
35          submodules: recursive
36      - name: Create package
37        run: |
38          cd $GITHUB_WORKSPACE
39          rm -rf bazel-bin/php/protobuf-*.tgz
40          $HOME/bin/bazel build php:release
41      - name: Compile extension
42        run: |
43          cd /tmp
44          MAKE="make -j$(nproc)" pecl install $GITHUB_WORKSPACE/bazel-bin/php/protobuf-*.tgz
45      - name: Enable extension
46        run: docker-php-ext-enable protobuf
47      - name: Inspect extension
48        run: php --ri protobuf
49