diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56cd0ba70..bd2a6663e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -117,16 +117,6 @@ jobs: command: check args: --target wasm32-unknown-unknown --no-default-features - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-wasi - - - name: Check compilation for wasi - uses: actions-rs/cargo@v1 - with: - command: check - args: --target wasm32-wasi --features freeze-stdlib - - uses: actions-rs/toolchain@v1 with: target: x86_64-unknown-freebsd @@ -333,3 +323,35 @@ jobs: PUBLISH_DIR: ./wasm/demo/dist EXTERNAL_REPOSITORY: RustPython/demo PUBLISH_BRANCH: master + + wasm-wasi: + name: Run snippets and cpython tests on wasm-wasi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-wasi + override: true + - name: Setup Wasmer + uses: wasmerio/setup-wasmer@v1 + - name: Install clang + run: sudo apt-get update && sudo apt-get install clang -y + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-wasm_opt3-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-debug_opt3-${{ hashFiles('**/Cargo.lock') }} + - name: build rustpython + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --target wasm32-wasi --features freeze-stdlib --verbose + - name: run snippets + run: wasmer run --dir . target/wasm32-wasi/release/rustpython.wasm -- extra_tests/snippets/variables.py