Skip to content

Commit cb6e5f4

Browse files
feat(ci): add e2e test for wizer via componentize-js use
This commit adds a e2e test of wizer via a known downstream consumer of wizer, componentize-js. Here we add a simple minimal JS app fixture w/ associated WIT and attempt to ensure that componentize-js can use it via the `--wizer-bin` option.
1 parent 396e243 commit cb6e5f4

File tree

4 files changed

+61
-3
lines changed

4 files changed

+61
-3
lines changed

.github/workflows/e2e.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: e2e
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
CARGO_TERM_COLOR: always
8+
9+
jobs:
10+
# Ensure that the wizer binary works via componentize-js
11+
componentize-js:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
examples:
16+
- folder: tests/fixtures/components/hello-world
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
20+
21+
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
22+
with:
23+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-cargo-
26+
path: |
27+
~/.cargo/registry
28+
~/.cargo/git
29+
target
30+
- run: cargo build --features=cli --release
31+
32+
# TODO: switch to NPM-released componentize-js once wizer bin is released
33+
- working-directory: ${{ matrix.example.folder }}
34+
run: |
35+
npm install git+https://github.com/bytecodealliance/componentize-js.git
36+
npx componentize-js \
37+
--wizer-bin=../../../../target/release/wizer \
38+
-w wit \
39+
-o component.wasm \
40+
component.js

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: Release
1+
name: release
2+
23
on:
34
push:
4-
branches: [main]
5-
tags-ignore: [dev]
5+
branches:
6+
- main
7+
tags-ignore:
8+
- dev
69
pull_request:
10+
711
defaults:
812
run:
913
shell: bash
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const test = {
2+
run() {
3+
return "Hello world!";
4+
}
5+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package wizer:test;
2+
3+
interface test {
4+
run: func() -> string;
5+
}
6+
7+
world component {
8+
export test;
9+
}

0 commit comments

Comments
 (0)