examples: add example running reactor component #912
Workflow file for this run
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
on: [push, pull_request, workflow_dispatch] | |
name: CI | |
jobs: | |
javascript: | |
name: Test JS | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install Deno toolchain | |
uses: denoland/setup-deno@v1 | |
- name: Install Node toolchain | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install JS build deps | |
run: | | |
cd js | |
npm ci | |
- name: Run Deno test | |
run: | | |
cd js/packages/observe-sdk-stdout | |
npm run build | |
npm run test:deno > out.txt | |
# test the expected content of the formatted output | |
ALLOCS=$(cat out.txt | grep "Allocation grew memory by 3 pages" | wc -l) | |
[ $ALLOCS -eq 10 ] | |
- name: Run Node test | |
run: | | |
cd js/packages/observe-sdk-stdout | |
npm run build | |
npm link | |
pushd test/node | |
npm link @dylibso/observe-sdk-stdout | |
popd | |
npm run test:node > out.txt | |
# test the expected content of the formatted output | |
ALLOCS=$(cat out.txt | grep "Allocation grew memory by 3 pages" | wc -l) | |
[ $ALLOCS -eq 10 ] | |
go: | |
name: Test Go | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install Go toolchain | |
uses: actions/setup-go@v4 | |
- name: Run go test | |
run: | | |
cd go | |
go test ./... | |
rust: | |
name: Test Rust | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v2 | |
with: | |
version: "23.4" | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all-features | |
- name: Run basic example | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --example=basic test/test.c.instr.wasm "Test" | |
- name: Run many example | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --example=many test/test.c.instr.wasm "Test" | |
- name: Run OpenTelemetry STDOUT example | |
run: | | |
cargo run --example=otel-stdout test/nested.c.instr.wasm > test.json | |
cat test.json \ | |
| head -n 1 \ | |
| jq '.resourceSpans[].scopeSpans[].spans[0].attributes[0]' \ | |
| jq '.key == "function_name", .value.stringValue == "_start"' | |
- name: Run Reactor example | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --example=reactor-hello test/reactor-hello.c.instr.wasm | |
- name: Install Component CLI Deps | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: wasm-tools cargo-component | |
- name: Install Just | |
uses: extractions/setup-just@v1 | |
- name: Build wit | |
run: just build_wit | |
- name: Component Demo | |
run: just component_demo | |
- name: Component Demo 2 | |
run: just component_demo_2 |