diff --git a/.github/workflows/wasm_ubuntu.yml b/.github/workflows/wasm_ubuntu.yml new file mode 100644 index 000000000..8a1edb099 --- /dev/null +++ b/.github/workflows/wasm_ubuntu.yml @@ -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 + diff --git a/scripts/packages.lua b/scripts/packages.lua index 34967531a..6aab8a16e 100644 --- a/scripts/packages.lua +++ b/scripts/packages.lua @@ -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 = {} diff --git a/scripts/test.lua b/scripts/test.lua index 404ae9a0b..b0db64045 100644 --- a/scripts/test.lua +++ b/scripts/test.lua @@ -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()