forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (94 loc) · 3.01 KB
/
wasix-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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