mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: add windows and macos jobs for checking the wasm backend too (#17451)
This commit is contained in:
parent
cdc0159c6e
commit
e2daa84a33
66
.github/workflows/wasm_backend_tests_ci.yml
vendored
66
.github/workflows/wasm_backend_tests_ci.yml
vendored
@ -72,24 +72,48 @@ jobs:
|
||||
- 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
|
||||
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
|
||||
|
||||
wasm-backend-windows:
|
||||
runs-on: windows-2022
|
||||
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.bat -msvc
|
||||
- name: Symlink V
|
||||
run: .\v.exe 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 msvc -showcc -v cmd/tools/builders/wasm_builder.v
|
||||
|
||||
- name: Test the WASM backend
|
||||
run: v -stats test vlib/v/gen/wasm/tests/
|
||||
|
||||
- name: Build examples
|
||||
run: $env:VTEST_ONLY='wasm'; v build-examples
|
||||
|
@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env -S v -raw-vsh-tmp-prefix tmp
|
||||
|
||||
import net.http
|
||||
import json
|
||||
import os
|
||||
import net.http
|
||||
|
||||
const github_job = os.getenv('GITHUB_JOB')
|
||||
|
||||
struct JQ {
|
||||
tag_name string
|
||||
@ -21,8 +22,16 @@ fn main() {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO: add retries here, github requests can fail
|
||||
jq := http.get_text('https://api.github.com/repos/WebAssembly/binaryen/releases/latest')
|
||||
tag := json.decode(JQ, jq)!.tag_name
|
||||
if github_job != '' {
|
||||
dump(jq)
|
||||
dump(tag)
|
||||
}
|
||||
*/
|
||||
tag := 'version_112'
|
||||
|
||||
name := $if windows {
|
||||
'x86_64-windows'
|
||||
@ -50,9 +59,6 @@ fn main() {
|
||||
// defer { os.rm(saveloc) or {}! }
|
||||
}
|
||||
|
||||
mkdir_all(loc)!
|
||||
println(loc)
|
||||
|
||||
println('Extracting `${tloc}/${fname}` to `${tloc}/binaryen` ...')
|
||||
cmd := 'tar -xvf ${saveloc} --directory ${tloc}'
|
||||
if os.system(cmd) != 0 {
|
||||
|
@ -1,10 +1,19 @@
|
||||
[translated]
|
||||
module binaryen
|
||||
|
||||
#flag -I@VEXEROOT/thirdparty/binaryen/include
|
||||
#flag -L@VEXEROOT/thirdparty/binaryen/lib
|
||||
#flag -lbinaryen -lstdc++
|
||||
#flag darwin -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,@VEXEROOT/thirdparty/binaryen/lib
|
||||
$if dynamic_binaryen ? {
|
||||
#flag -lbinaryen
|
||||
} $else {
|
||||
#flag -lbinaryen
|
||||
#flag -I@VEXEROOT/thirdparty/binaryen/include
|
||||
#flag -L@VEXEROOT/thirdparty/binaryen/lib
|
||||
|
||||
#flag darwin -lc++ -Wl,-rpath,"@executable_path/../../../thirdparty/binaryen/lib"
|
||||
// the following, allows linking to the binaryen package from `brew install binaryen`, without having to run cmd/tools/install_binaryen.vsh first
|
||||
#flag darwin -I/opt/homebrew/include -L/opt/homebrew/lib -Wl,-rpath,"/opt/homebrew/lib"
|
||||
|
||||
#flag linux -lstdc++
|
||||
}
|
||||
|
||||
type Index = u32
|
||||
type Type = u64
|
||||
|
Loading…
Reference in New Issue
Block a user