Add libphp build and CI #104
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: WASIX build and test | |
| on: | |
| workflow_call: | |
| pull_request: | |
| branches: | |
| - "*-wasix" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| variant: ["32", "64"] | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: "recursive" | |
| path: php | |
| - name: Check out php-wasix-deps | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: wasix-org/php-wasix-deps | |
| submodules: "recursive" | |
| path: php-wasix-deps | |
| - name: OS Setup (Ubuntu) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential wabt re2c curl xz-utils tar | |
| npm i -g pnpm concurrently | |
| wget https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-x86_64-linux.tar.gz | |
| tar -xzf binaryen-version_123-x86_64-linux.tar.gz | |
| sudo cp binaryen-version_123/bin/* /usr/bin/ | |
| - name: Install wasixcc | |
| uses: wasix-org/wasixcc@main | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| sysroot-tag: v2026-02-16.1 | |
| version: v0.3.0 | |
| - name: Tool Versions | |
| run: | | |
| echo wasixcc | |
| wasixcc -v | |
| echo '####################' | |
| echo wasixar | |
| wasixar -V | |
| echo '####################' | |
| echo wasixnm | |
| wasixnm -V | |
| echo '####################' | |
| echo wasixranlib | |
| wasixranlib -V | |
| echo '####################' | |
| echo wasm-opt | |
| wasm-opt --version | |
| echo '####################' | |
| echo wasm-strip | |
| wasm-strip --version | |
| - name: Build | |
| run: | | |
| export PHP_WASIX_DEPS=$(pwd)/php-wasix-deps | |
| cd php | |
| bash wasix-configure-eh-${{ matrix.variant }}.sh || { cat config.log; exit -1; } | |
| bash wasix-build-eh.sh | |
| - name: Setup Wasmer | |
| uses: wasmerio/setup-wasmer@v3.1 | |
| - name: Run WASIX tests | |
| run: | | |
| cd php | |
| bash wasix-test-start-containers.sh | |
| conc --kill-others --success "command-1" \ | |
| "bash wasix-test-server.sh" \ | |
| "bash wasix-test-run.sh" | |
| bash wasix-test-stop-containers.sh | |
| echo All tests are passing! 🎉 | |
| - name: Archive build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: php-wasix-${{ matrix.variant }} | |
| path: php/sapi/cli/php.wasm | |
| build-libphp: | |
| name: Build libphp | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| variant: ["32", "64"] | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: "recursive" | |
| path: php | |
| - name: Check out php-wasix-deps | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: wasix-org/php-wasix-deps | |
| submodules: "recursive" | |
| path: php-wasix-deps | |
| - name: OS Setup (Ubuntu) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential wabt re2c curl xz-utils tar | |
| npm i -g pnpm concurrently | |
| wget https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-x86_64-linux.tar.gz | |
| tar -xzf binaryen-version_123-x86_64-linux.tar.gz | |
| sudo cp binaryen-version_123/bin/* /usr/bin/ | |
| - name: Install wasixcc | |
| uses: wasix-org/wasixcc@main | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| sysroot-tag: v2026-02-16.1 | |
| version: v0.3.0 | |
| - name: Tool Versions | |
| run: | | |
| echo wasixcc | |
| wasixcc -v | |
| echo '####################' | |
| echo wasixar | |
| wasixar -V | |
| echo '####################' | |
| echo wasixnm | |
| wasixnm -V | |
| echo '####################' | |
| echo wasixranlib | |
| wasixranlib -V | |
| echo '####################' | |
| echo wasm-opt | |
| wasm-opt --version | |
| echo '####################' | |
| echo wasm-strip | |
| wasm-strip --version | |
| - name: Build | |
| run: | | |
| export PHP_WASIX_DEPS=$(pwd)/php-wasix-deps | |
| cd php | |
| bash wasix-configure-libphp-${{ matrix.variant }}.sh || { cat config.log; exit -1; } | |
| bash wasix-build-libphp.sh | |
| - name: Archive build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libphp-wasix-${{ matrix.variant }} | |
| path: php/install |