-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Lib] fix `Socket::get_peer` & `Socket::get_local` * [Misc] Bump to 0.5.1 * [CI] add 0.12 * [Lib] compatible with version 0.12.1 and earlier ver.
- Loading branch information
Showing
4 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: examples 0.12 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'info' | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install apt-get packages | ||
run: | | ||
sudo ACCEPT_EULA=Y apt-get update | ||
sudo ACCEPT_EULA=Y apt-get upgrade | ||
sudo apt-get install wget git curl software-properties-common build-essential | ||
- name: Install Rust target | ||
run: | | ||
rustup target add wasm32-wasi | ||
- name: Install WasmEdge | ||
run: | | ||
VERSION=0.12.1 | ||
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -e all --version=$VERSION --tf-version=$VERSION --tf-deps-version=$VERSION --tf-tools-version=$VERSION --image-version=$VERSION -p /usr/local | ||
# Disable this example due to it relies on wasmedge_http_req, which is a cyclic dependence | ||
# - name: HTTP client example | ||
# run: | | ||
# cd examples/http_client/ | ||
# cargo build --target wasm32-wasi --release | ||
# wasmedge target/wasm32-wasi/release/http_client.wasm | ||
|
||
- name: HTTP async client example | ||
run: | | ||
cd examples/nonblock_http_client/ | ||
cargo build --target wasm32-wasi --release | ||
wasmedge target/wasm32-wasi/release/nonblock_http_client.wasm | ||
- name: HTTP server example | ||
run: | | ||
cd examples/http_server/ | ||
cargo build --target wasm32-wasi --release | ||
nohup wasmedge target/wasm32-wasi/release/http_server.wasm & | ||
echo $! > wasmedge.pid | ||
wasmedge_pid=$(cat wasmedge.pid) | ||
sleep 5 | ||
echo "fds:" | ||
ls /proc/$wasmedge_pid/fd | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
echo "Server response is $resp" | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
resp=$(curl -X POST http://127.0.0.1:1234 -d "name=WasmEdge") | ||
echo "after 6 request, fds:" | ||
ls /proc/$wasmedge_pid/fd | ||
kill -9 $wasmedge_pid | ||
rm wasmedge.pid | ||
- name: UDP Socket Example | ||
run: | | ||
cargo build --target wasm32-wasi --example=udp_socket --release --no-default-features --features=built-in-dns | ||
wasmedge target/wasm32-wasi/release/examples/udp_socket.wasm | ||
- name: DNS Example | ||
run: | | ||
cargo build --target wasm32-wasi --example=get_addrinfo --release | ||
wasmedge target/wasm32-wasi/release/examples/get_addrinfo.wasm | ||
- name: ToSocketAddrs Example | ||
run: | | ||
cargo build --target wasm32-wasi --example=socket_addr --release | ||
wasmedge target/wasm32-wasi/release/examples/socket_addr.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "wasmedge_wasi_socket" | ||
version = "0.5.0" | ||
version = "0.5.1" | ||
authors = ["Yi <[email protected]>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters