-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
52 lines (42 loc) · 1.75 KB
/
wasm32.yml
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
name: WebAssembly CI
on: [push, pull_request]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
SPEC_SPLIT_DOTS: 160
jobs:
wasm32-test:
runs-on: ubuntu-24.04
container: crystallang/crystal:1.14.0-build
steps:
- name: Download Crystal source
uses: actions/checkout@v4
- name: Install wasmtime
uses: mwilliamson/setup-wasmtime-action@v2
with:
wasmtime-version: "2.0.0"
- name: Install LLVM
run: |
apt-get update
apt-get remove -y 'llvm-*' 'libllvm*'
apt-get install -y curl software-properties-common
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
apt-add-repository -y deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main
apt-get install -y llvm-18-dev lld-18
ln -s $(which wasm-ld-18) /usr/bin/wasm-ld
- name: Download wasm32 libs
run: |
mkdir wasm32-wasi-libs
curl -LO https://github.com/lbguilherme/wasm-libs/releases/download/0.0.3/wasm32-wasi-libs.tar.gz
echo "cd36f319f8f9f9cd08f723d10e6ec2b92f2e44d3ce3b20344b8041386d85c261 wasm32-wasi-libs.tar.gz" | sha256sum -c -
tar -f wasm32-wasi-libs.tar.gz -C wasm32-wasi-libs -xz
rm wasm32-wasi-libs.tar.gz
- name: Build spec/wasm32_std_spec.cr
run: bin/crystal build spec/wasm32_std_spec.cr -o wasm32_std_spec.wasm --target wasm32-wasi -Dwithout_iconv -Dwithout_openssl
env:
CRYSTAL_LIBRARY_PATH: ${{ github.workspace }}/wasm32-wasi-libs
- name: Run wasm32_std_spec.wasm
run: |
wasmtime run wasm32_std_spec.wasm