1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

wasm: add a webassembly compiler backend, based on using binaryen (#17368)

This commit is contained in:
l-m
2023-03-01 08:58:53 +11:00
committed by GitHub
parent b9a8a21094
commit 0625caad56
51 changed files with 7981 additions and 8 deletions

View File

@@ -10,7 +10,6 @@ on:
- 'vlib/builtin/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
@@ -31,7 +30,6 @@ on:
- 'vlib/builtin/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'

View File

@@ -0,0 +1,95 @@
name: wasm backend CI
on:
push:
paths:
- '!**'
- '!**.md'
- 'cmd/tools/builders/**.v'
- 'vlib/builtin/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/v/preludes/**.v'
- 'vlib/v/gen/wasm/**.v'
- 'vlib/v/gen/wasm/tests/**.v'
pull_request:
paths:
- '!**'
- '!**.md'
- 'cmd/tools/builders/**.v'
- 'vlib/builtin/**.v'
- 'vlib/v/ast/**.v'
- 'vlib/v/scanner/**.v'
- 'vlib/v/parser/**.v'
- 'vlib/v/checker/**.v'
- 'vlib/v/gen/c/**.v'
- 'vlib/v/builder/**.v'
- 'vlib/v/cflag/**.v'
- 'vlib/v/live/**.v'
- 'vlib/v/util/**.v'
- 'vlib/v/markused/**.v'
- 'vlib/v/preludes/**.v'
- 'vlib/v/gen/wasm/**.v'
- 'vlib/v/gen/wasm/tests/**.v'
concurrency:
group: wasm-backend-ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
wasm-backend-ubuntu:
runs-on: ubuntu-22.04
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
timeout-minutes: 121
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y clang gcc
- name: Build V
run: make -j4 && ./v symlink -githubci
- name: Install binaryen as build dependency for the V WASM backend
run: ./v cmd/tools/install_binaryen.vsh
- name: Build the V WASM backend
run: ./v -cc clang -showcc -v cmd/tools/builders/wasm_builder.v
- name: Test the WASM backend
run: ./v test vlib/v/gen/wasm/tests/
- name: Build examples
run: VTEST_ONLY=wasm ./v build-examples
## wasm-backend-macos:
## runs-on: macOS-12
## if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
## timeout-minutes: 121
## steps:
## - uses: actions/checkout@v3
##
## - name: Build V
## run: make -j4 && ./v symlink -githubci
##
## - name: Install binaryen as build dependency for the V WASM backend
## run: ./v cmd/tools/install_binaryen.vsh
##
## - name: Build the V WASM backend
## run: ./v -cc clang -showcc -v cmd/tools/builders/wasm_builder.v
##
## - name: Test the WASM backend
## run: ./v test vlib/v/gen/wasm/tests/
##
## - name: Build examples
## run: VTEST_ONLY=wasm ./v build-examples