-
Notifications
You must be signed in to change notification settings - Fork 233
208 lines (192 loc) · 6.43 KB
/
main.yml
File metadata and controls
208 lines (192 loc) · 6.43 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
buildlibc:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env: ${{ matrix.env || fromJSON('{}') }}
strategy:
fail-fast: false
matrix:
include:
# Test a number of operating systems and architectures to make sure
# wasi-libc builds on these platforms by default.
- name: Build on Linux x86_64
os: ubuntu-24.04
clang_version: 16
upload: linux-x86_64-clang-16
- name: Build on Linux aarch64
os: ubuntu-24.04-arm
clang_version: 16
upload: linux-aarch64-clang-16
- name: Build on macOS aarch64
os: macos-15
clang_version: 15.0.7
llvm_asset_suffix: arm64-apple-darwin22.0
upload: macos-clang-15
- name: Build on Windows x86_64
os: windows-2025
clang_version: 16.0.0
upload: windows-clang-16
# Other versions of LLVM
- name: Build with LLVM 11
os: ubuntu-22.04
clang_version: 11
upload: linux-x86_64-clang-11
env:
BUILD_LIBSETJMP: no
- name: Build with LLVM 19
os: ubuntu-24.04
clang_version: 19
upload: linux-x86_64-clang-19
env:
MAKE_TARGETS: "default libc_so"
- name: Build with LLVM 18
os: ubuntu-24.04
clang_version: 18
upload: linux-x86_64-clang-18
env:
MAKE_TARGETS: "default libc_so"
# Test various combinations of targets triples.
#
# Configuration here can happen through `env` which is inherited to
# jobs below. For now this only runs tests on Linux with Clang 16,
# but that can be expanded as necessary in the future too. Note that
# some targets run the build for the `libc_so` makefile target to
# ensure the PIC build works.
- name: Test wasm32-wasi
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasi
env:
TARGET_TRIPLE: wasm32-wasi
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasip1
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip1
env:
TARGET_TRIPLE: wasm32-wasip1
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasip2
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip2
env:
TARGET_TRIPLE: wasm32-wasip2
WASI_SNAPSHOT: p2
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasi-threads
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasi-threads
env:
TARGET_TRIPLE: wasm32-wasi-threads
THREAD_MODEL: posix
- name: Test wasm32-wasip1-threads
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip1-threads
env:
TARGET_TRIPLE: wasm32-wasip1-threads
THREAD_MODEL: posix
- name: Test wasm32-wasip1 in V8
os: ubuntu-24.04
clang_version: 16
test: true
test_with_v8: true
env:
TARGET_TRIPLE: wasm32-wasip1
- name: Test wasm32-wasip1-threads in V8
os: ubuntu-24.04
clang_version: 16
test: true
test_with_v8: true
env:
TARGET_TRIPLE: wasm32-wasip1-threads
THREAD_MODEL: posix
- name: Test wasm32-wasi-simd
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasi-simd
env:
MAKE_TARGETS: "no-check-symbols"
EXTRA_CFLAGS: "-O2 -DNDEBUG -msimd128 -mrelaxed-simd -mbulk-memory -D__wasilibc_simd_string"
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- uses: ./.github/actions/setup
with:
clang_version: ${{ matrix.clang_version }}
llvm_asset_suffix: ${{ matrix.llvm_asset_suffix }}
- name: Build libc
run: make -j4 $MAKE_TARGETS
- name: Download Test dependencies
if: matrix.test
run: cd test && make download
- name: Install V8 dependencies
if: matrix.test_with_v8
run: |
npm -C test/scripts/browser-test install
npx -C test/scripts/browser-test playwright install chromium-headless-shell
echo ENGINE="$PWD/test/scripts/browser-test/harness.mjs" >> $GITHUB_ENV
- name: Test
if: matrix.test
run: make -C test test
- uses: actions/upload-artifact@v4.4.0
if: matrix.upload
with:
name: ${{ format( 'sysroot-{0}.tgz', matrix.upload) }}
path: sysroot
# Disable the headerstest job for now, while WASI transitions from the
# witx snapshots to wit proposals, and we have a few manual edits to the
# generated header to make life easier for folks.
headerstest:
if: ${{ false }} # Disable the headers test for now.
name: wasi-headers test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-15, windows-2025]
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update stable --no-self-update && rustup default stable
if: matrix.os != 'macos-15'
- name: Install Rust (macos)
run: |
curl https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
if: matrix.os == 'macos-15'
- run: cargo fetch
working-directory: tools/wasi-headers
- run: cargo build
working-directory: tools/wasi-headers
- run: cargo test
working-directory: tools/wasi-headers
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
working-directory: tools/wasi-headers