diff --git a/.github/workflows/libdyntype_ci.yaml b/.github/workflows/libdyntype_ci.yaml new file mode 100644 index 00000000..800a7028 --- /dev/null +++ b/.github/workflows/libdyntype_ci.yaml @@ -0,0 +1,50 @@ +# +# Copyright (C) 2023 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +name: libdyntype CI + +on: + push: + paths: + - "runtime-library/**" + pull_request: + paths: + - "runtime-library/**" + # allow to be triggered manually + workflow_dispatch: + +jobs: + build_and_test: + name: 'Libdyntype Build and Test' + runs-on: ubuntu-latest + defaults: + run: + working-directory: runtime-library/libdyntype + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + submodules: true + + - name: download dependencies + run: | + ./download.sh + working-directory: runtime-library/deps + + - name: Dyntype Build + run: | + git pull --recurse-submodules + git submodule update --remote --recursive + mkdir build && cd build + cmake .. && make + + - name: Dyntype Test + run: | + cd test + mkdir build && cd build + cmake .. + make + make test diff --git a/.github/workflows/ts2wasm_ci.yaml b/.github/workflows/ts2wasm_ci.yaml new file mode 100644 index 00000000..51e8c0db --- /dev/null +++ b/.github/workflows/ts2wasm_ci.yaml @@ -0,0 +1,96 @@ +# +# Copyright (C) 2023 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# + +name: ts2wasm-compiler CI + +on: + push: + paths-ignore: + - "doc/**" + - "README.md" + pull_request: + types: + - opened + - synchronize + paths-ignore: + - "doc/**" + - "README.md" + # allow to be triggered manually + workflow_dispatch: + +# Cancel any in-flight jobs for the same PR/branch so there's only one active +# at a time +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + install_dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + # node-version: [10.x, 12.x, 14.x, 15.x, 16.x] + # Test the latest version of Node.js plus the last two LTS versions. + # node-version: + # - "*" + # - lts/* + # - lts/-1 + node-version: [16.x] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + + - name: Use node version ${{ matrix.node-version }} + uses: actions/setup-node@v3 + - run: npm install + + - name: Linter + run: npx lint-staged + + validate_compilation: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + - run: npm install + + - name: Test compilation + run: + npm run test + + validate_execution: + needs: + [install_dependencies] + runs-on: ubuntu-latest + strategy: + matrix: + target: [ + "X86_64", "X86_32" + ] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + + - name: download dependencies + run: | + ./download.sh + sudo apt update && sudo apt install g++-multilib -y + working-directory: runtime-library/deps + + - name: Build runtime + run: | + mkdir build && cd build + cmake .. -DWAMR_BUILD_TARGET=${{ matrix.target }} -DWAMR_GC_IN_EVERY_ALLOCATION=1 -DUSE_SANITIZER=1 && make -j$(nproc) + working-directory: runtime-library/ + + - name: Validate execution + run: + npm start + working-directory: tools/validate/wamr diff --git a/ATTRIBUTIONS.md b/ATTRIBUTIONS.md index 4f75dd01..b13670d0 100644 --- a/ATTRIBUTIONS.md +++ b/ATTRIBUTIONS.md @@ -22,6 +22,7 @@ Wasmnizer-ts project reused some components from other open source project: ### AssemblyScript [LICENSE](./src/backend/binaryen/glue/LICENSE) (Apache-2.0) + [NOTICE](./src/backend/binaryen/glue/NOTICE) ### TypeScript diff --git a/README.md b/README.md index e46a74d4..e6118a30 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ## Overview -`Wasmnizer-ts` is a toolchain for compiling TypeScript source code directly into [WasmGC](https://github.com/WebAssembly/gc) bytecode. The strategy is to apply static compilation for those with sufficient type information, while supporting dynamic type (such as any) through host APIs. The `Wasmnizer-ts` now supports a strict subset of TypeScript and continuously strives to accommodate more semantics. +`Wasmnizer-ts` utilizes [WasmGC](https://github.com/WebAssembly/gc) to compile TypeScript source code into WebAssembly bytecode, and support dynamic type (such as any) through host APIs. The `Wasmnizer-ts` now supports a strict subset of TypeScript and continuously strives to accommodate more semantics. There are three components in `Wasmnizer-ts`: - `ts2wasm-compiler`: a compiler for compiling TypeScript source code into WasmGC bytecode. @@ -46,7 +46,11 @@ The wasm module generated by `ts2wasm-compiler` is designed to be executed in a - **[libstruct-indirect API](./doc/libstruct_indirect_api_spec.md) (required by `interface` type)**: APIs for accessing WasmGC struct fields through index calculated during runtime. - **libstd API (required by standard libraries)**: APIs for providing standard libraries from host environment. -`Wasmnizer-ts` currently provides `libdyntype API`, `libstruct-indirect API` and `libstd API` based on [WebAssembly Micro Runtime (WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime/tree/dev/gc_refactor), and provides part of `libdyntype API` for chrome browser. Please see [feature list](./doc/developer-guide/feature_list.md) for supporting status of each feature. +`Wasmnizer-ts` currently implemented host APIs on multiple environments: + - [WebAssembly Micro Runtime (WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime/tree/dev/gc_refactor): `libdyntype API`, `libstruct-indirect API` and `libstd API` + - chrome browser and nodejs (20.6.1+): part of `libdyntype API` implemented with JavaScript + +Please see [feature list](./doc/developer-guide/feature_list.md) for supporting status of each feature. Please goto [Getting Started](./doc/getting_started.md) for how to use the project and [Introduction](./doc/developer-guide/index.md) for more details.