File tree Expand file tree Collapse file tree 5 files changed +170
-0
lines changed Expand file tree Collapse file tree 5 files changed +170
-0
lines changed Original file line number Diff line number Diff line change 1+ name : apt
2+ inputs :
3+ wasi_sdk_version :
4+ default : 19
5+ wasmtime_version :
6+ default : 5.0.0
7+ binaryen_version :
8+ default : 111
9+ runs :
10+ using : composite
11+ steps :
12+ - shell : bash
13+ run : |
14+ set -x
15+
16+ sudo apt-get update
17+ sudo apt-get install \
18+ php \
19+ libtool-bin \
20+ bison \
21+ re2c \
22+ tcl
23+ - shell : bash
24+ run : |
25+ set -x
26+
27+ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ inputs.wasi_sdk_version }}/wasi-sdk_${{ inputs.wasi_sdk_version }}.0_amd64.deb
28+ sudo dpkg -i wasi-sdk_${{ inputs.wasi_sdk_version }}.0_amd64.deb
29+ - shell : bash
30+ run : |
31+ echo /opt/wasi-sdk/bin >> $GITHUB_PATH
32+ - shell : bash
33+ run : |
34+ set -x
35+
36+ mkdir -p /opt/bin
37+
38+ wget https://github.com/bytecodealliance/wasmtime/releases/download/v${{ inputs.wasmtime_version }}/wasmtime-v${{ inputs.wasmtime_version }}-x86_64-linux.tar.xz
39+ tar -xvf wasmtime-v${{ inputs.wasmtime_version }}-x86_64-linux.tar.xz
40+ mv wasmtime-v${{ inputs.wasmtime_version }}-x86_64-linux/wasmtime /opt/bin/
41+ - shell : bash
42+ run : |
43+ set -x
44+
45+ mkdir -p /opt/bin
46+
47+ wget https://github.com/WebAssembly/binaryen/releases/download/version_${{ inputs.binaryen_version }}/binaryen-version_${{ inputs.binaryen_version }}-x86_64-linux.tar.gz
48+ tar -xvf binaryen-version_${{ inputs.binaryen_version }}-x86_64-linux.tar.gz --strip-components=2 -C /opt/bin binaryen-version_${{ inputs.binaryen_version }}/bin/wasm-opt
Original file line number Diff line number Diff line change 1+ name : ./configure
2+ inputs :
3+ configurationParameters :
4+ default : ' '
5+ required : false
6+ runs :
7+ using : composite
8+ steps :
9+ - shell : bash
10+ run : |
11+ set -x
12+
13+ ./buildconf --force
14+ ./configure \
15+ --host=wasm32-wasi \
16+ --target=wasm32-wasi \
17+ --without-libxml \
18+ --disable-dom \
19+ --without-iconv \
20+ --without-openssl \
21+ --disable-simplexml \
22+ --disable-xml \
23+ --disable-xmlreader \
24+ --disable-xmlwriter \
25+ --without-pear \
26+ --disable-phar \
27+ --disable-opcache \
28+ --disable-zend-signals \
29+ --without-pcre-jit \
30+ --without-sqlite3 \
31+ --disable-pdo \
32+ --disable-fiber-asm \
33+ --disable-posix \
34+ --disable-sockets \
35+ CFLAGS="-D_WASI_EMULATED_GETPID -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS" \
36+ LDFLAGS="-lwasi-emulated-getpid -lwasi-emulated-signal -lwasi-emulated-process-clocks" \
37+ ${{ inputs.configurationParameters }}
Original file line number Diff line number Diff line change 1+ name : optimize
2+ runs :
3+ using : composite
4+ steps :
5+ - shell : bash
6+ run : |
7+ set -x
8+
9+ /opt/bin/wasm-opt -O sapi/cli/php -o sapi/cli/php.optimized
Original file line number Diff line number Diff line change 1+ name : Test
2+ inputs :
3+ testArtifacts :
4+ default : null
5+ required : false
6+ runTestsParameters :
7+ default : ' '
8+ required : false
9+ runs :
10+ using : composite
11+ steps :
12+ - shell : bash
13+ run : |
14+ cat <<-'EOF' > /opt/bin/run-tests.sh
15+ #!/bin/sh
16+ WASMTIME_BACKTRACE_DETAILS=1 /opt/bin/wasmtime run --mapdir /::/ $PHP_ROOT_PATH/sapi/cli/php.optimized 2> /dev/null -- "$@"
17+ EOF
18+ chmod +x /opt/bin/run-tests.sh
19+ - shell : bash
20+ run : |
21+ set -x
22+ export PHP_ROOT_PATH=$PWD
23+ export SKIP_IO_CAPTURE_TESTS=1
24+ export TEST_PHP_JUNIT=junit.out.xml
25+ export STACK_LIMIT_DEFAULTS_CHECK=1
26+ php run-tests.php -q ${{ inputs.runTestsParameters }} \
27+ -p /opt/bin/run-tests.sh \
28+ -j$(/usr/bin/nproc) \
29+ -g FAIL,BORK,LEAK,XLEAK \
30+ --no-progress \
31+ --offline \
32+ --show-diff \
33+ --show-slow 1000 \
34+ --set-timeout 120 \
35+ tests/lang \
36+ tests/output \
37+ tests/strings
38+ - uses : actions/upload-artifact@v3
39+ if : always() && inputs.testArtifacts != null
40+ with :
41+ name : ${{ github.job }}_${{ inputs.testArtifacts }}
42+ path : ${{ github.workspace }}/junit.out.xml
43+ retention-days : 5
Original file line number Diff line number Diff line change @@ -140,3 +140,36 @@ jobs:
140140 -d opcache.jit_buffer_size=16M
141141 - name : Verify generated files are up to date
142142 uses : ./.github/actions/verify-generated-files
143+ WASM32_WASI :
144+ name : " WASM32_WASI_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
145+ runs-on : ubuntu-20.04
146+ env :
147+ CC : clang
148+ CXX : clang++
149+ LD : wasm-ld
150+ AR : llvm-ar
151+ RANLIB : llvm-ranlib
152+ steps :
153+ - name : git checkout
154+ uses : actions/checkout@v3
155+ - name : apt
156+ uses : ./.github/actions/apt-wasi
157+ - name : ./configure
158+ uses : ./.github/actions/configure-wasi
159+ with :
160+ configurationParameters : >-
161+ --${{ matrix.debug && 'enable' || 'disable' }}-debug
162+ --${{ matrix.zts && 'enable' || 'disable' }}-zts
163+ - name : make
164+ env :
165+ CFLAGS : " -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS"
166+ LDFLAGS : " -lwasi-emulated-getpid -lwasi-emulated-signal -lwasi-emulated-process-clocks"
167+ run : make -j$(/usr/bin/nproc) cgi cli
168+ - name : optimize
169+ uses : ./.github/actions/optimize-wasi
170+ - name : Test
171+ uses : ./.github/actions/test-wasi
172+ with :
173+ testArtifacts : ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
174+ - name : Verify generated files are up to date
175+ uses : ./.github/actions/verify-generated-files
You can’t perform that action at this time.
0 commit comments