Add wasm ci (#1293)

* add wasm

* improve wasm ci

* improve wasm ci

* improve wasm ci

* improve tests

* improve ci
pull/1295/head
ruki 3 years ago committed by GitHub
parent 0e1f48f33a
commit e56cd20641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      .github/workflows/wasm_ubuntu.yml
  2. 2
      scripts/packages.lua
  3. 2
      scripts/test.lua

@ -0,0 +1,40 @@
name: Wasm (Ubuntu)
on:
pull_request:
branches:
- dev
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
kind: [static, shared]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-MingW-Ubuntu-${{ matrix.kind }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
- name: Prepare
uses: mymindstorm/setup-emsdk@v11
with:
# Make sure to set a version number!
version: 1.38.40
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: emsdk-cache-${{ matrix.kind }}
- name: Tests
run: |
emcc -v
xmake l ./scripts/test.lua -D -p wasm -k ${{ matrix.kind }} zlib

@ -71,7 +71,7 @@ function main(opt)
instance._BASE = package.load_from_repository(basename, nil, basedir, basefile)
end
if instance then
for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd", "cross"}) do
for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd", "wasm", "cross"}) do
local archs = platform.archs(plat)
if archs then
local package_archs = {}

@ -123,7 +123,7 @@ function _package_is_supported(argv, packagename)
if package and packagename:split("%s+")[1] == package.name then
local arch = argv.arch
if not arch and plat ~= os.subhost() then
arch = platform.archs(plat)[1]
arch = table.wrap(platform.archs(plat))[1]
end
if not arch then
arch = os.subarch()

Loading…
Cancel
Save