-
Notifications
You must be signed in to change notification settings - Fork 7
135 lines (110 loc) · 3.39 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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: Install Component CLI Deps
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-tools@^1.0.57 [email protected]
- name: Install Just
uses: extractions/setup-just@v1
# building wit is necessary for cargo test
- name: Build wit
run: just build_wit
- 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: Component Demo
run: just component_demo
- name: Component Demo 2
run: just component_demo_2
- name: Component Demo 3
run: just component_demo_3