Add release workflow #38
Workflow file for this run
This file contains 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: | |
secrets: | |
SENDMAIL_DEFAULT_USERNAME: | |
required: true | |
SENDMAIL_DEFAULT_PASSWORD: | |
required: true | |
pull_request: | |
branches: | |
- "*-wasix" | |
jobs: | |
build-and-test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
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 llvm-15 libclang-dev clang-15 wabt re2c | |
npm i -g wasm-opt pnpm concurrently | |
sudo rm /usr/bin/clang | |
sudo rm /usr/bin/clang++ | |
sudo ln -s /usr/bin/clang-15 /usr/bin/clang | |
sudo ln -s /usr/bin/clang++-15 /usr/bin/clang++ | |
sudo ln -s /usr/bin/llvm-ar-15 /usr/bin/llvm-ar | |
sudo ln -s /usr/bin/llvm-nm-15 /usr/bin/llvm-nm | |
sudo ln -s /usr/bin/llvm-ranlib-15 /usr/bin/llvm-ranlib | |
sudo ln -s /usr/bin/llvm-objdump-15 /usr/bin/llvm-objdump | |
- name: Tool Versions | |
run: | | |
echo clang | |
clang -v | |
echo '####################' | |
echo llvm-ar | |
llvm-ar -V | |
echo '####################' | |
echo llvm-nm | |
llvm-nm -V | |
echo '####################' | |
echo llvm-ranlib | |
llvm-ranlib -v | |
echo '####################' | |
echo wasm-opt | |
wasm-opt --version | |
echo '####################' | |
echo wasm-strip | |
wasm-strip --version | |
- name: Download wasix-libc | |
uses: dsaltares/fetch-gh-release-asset@1.1.2 | |
with: | |
repo: wasix-org/rust | |
file: wasix-libc.tar.gz | |
target: sysroot/wasix-libc.tar.gz | |
- name: Unpack wasix-libc | |
run: | | |
cd sysroot | |
tar xzf wasix-libc.tar.gz | |
- name: Build | |
env: | |
SENDMAIL_DEFAULT_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }} | |
SENDMAIL_DEFAULT_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }} | |
run: | | |
export SYSROOT=$(pwd)/sysroot/wasix-libc/sysroot32 | |
export PHP_WASIX_DEPS=$(pwd)/php-wasix-deps | |
cd php | |
bash wasix-configure.sh || { cat config.log; exit -1; } | |
- 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" \ | |
"sleep 20 && bash wasix-test-run.sh" | |
bash wasix-test-stop-containers.sh | |
echo All tests are passing! 🎉 | |
- name: Archive build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: php-wasix | |
path: php/sapi/cli/php.wasm |