-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (74 loc) · 2.28 KB
/
ci.yml
File metadata and controls
87 lines (74 loc) · 2.28 KB
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
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
rust:
name: rust crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install rust toolchain
run: |
rustup update stable
rustup default stable
rustup target add wasm32-unknown-unknown
- name: cargo test (native)
run: cargo test --manifest-path crates/dhamaka-runtime/Cargo.toml
- name: build wasm
run: crates/dhamaka-runtime/build.sh
- name: upload wasm artifact
uses: actions/upload-artifact@v4
with:
name: dhamaka-runtime-wasm
path: packages/hub/public/runtime/dhamaka-runtime.wasm
if-no-files-found: error
js:
name: js (node ${{ matrix.node }})
runs-on: ubuntu-latest
needs: rust
strategy:
fail-fast: false
matrix:
node: ["20", "22"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: download wasm artifact
uses: actions/download-artifact@v4
with:
name: dhamaka-runtime-wasm
path: packages/hub/public/runtime
- name: install workspace links
run: npm install
- name: syntax check
run: |
find packages -name '*.js' -not -path '*/node_modules/*' \
| xargs -n1 node --check
- name: run tests
run: npm test
- name: smoke test dev server
run: |
node packages/playground/server.js &
SERVER_PID=$!
sleep 2
for url in \
"http://localhost:5174/" \
"http://localhost:5174/hub.js" \
"http://localhost:5174/manifest.json" \
"http://localhost:5174/runtime/dhamaka-runtime.wasm" \
"http://localhost:5173/" \
"http://localhost:5173/sdk/index.js" \
"http://localhost:5173/runtime/index.js"; do
code=$(curl -s -o /dev/null -w "%{http_code}" "$url")
if [ "$code" != "200" ]; then
echo "FAIL: $url returned $code"
kill $SERVER_PID 2>/dev/null || true
exit 1
fi
echo "OK: $url"
done
kill $SERVER_PID 2>/dev/null || true