@@ -58,19 +58,21 @@ jobs:
58
58
fail-fast : false
59
59
matrix :
60
60
os : [ubuntu-latest, macos-latest, windows-latest]
61
+ lang : [c, rust, teavm-java, go, csharp]
61
62
runs-on : ${{ matrix.os }}
62
63
steps :
63
64
- uses : actions/checkout@v4
64
65
with :
65
66
submodules : true
66
67
- name : Install Rust
67
68
run : rustup update stable --no-self-update && rustup default stable
68
- - name : Install wasm32-unknown-unknown target
69
- run : rustup target add wasm32-unknown-unknown
70
- - name : Install wasm32-wasi target
71
- run : rustup target add wasm32-wasi
69
+ - run : rustup target add wasm32-wasip1
70
+
71
+ - run : rustup target add wasm32-unknown-unknown
72
+ if : matrix.lang == 'rust'
72
73
73
74
- uses : ./.github/actions/install-wasi-sdk
75
+ if : matrix.lang == 'c' || (matrix.lang == 'csharp' && matrix.os == 'windows-latest')
74
76
75
77
- run : |
76
78
curl.exe -LO https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
@@ -80,25 +82,45 @@ jobs:
80
82
echo $LOCALAPPDATA'\Microsoft\dotnet' >> $GITHUB_PATH
81
83
echo $LOCALAPPDATA'\Microsoft\dotnet\tools' >> $GITHUB_PATH
82
84
$LOCALAPPDATA/Microsoft/dotnet/dotnet --info
83
- if : matrix.os == 'windows-latest'
85
+ if: matrix.os == 'windows-latest' && matrix.lang == 'csharp '
84
86
85
87
- run : ci/download-teavm.sh
86
-
87
- - uses : actions/setup-node@v4
88
- with :
89
- node-version : ' 16'
88
+ if : matrix.lang == 'teavm-java'
90
89
- uses : actions/setup-java@v4
90
+ if : matrix.lang == 'teavm-java'
91
91
with :
92
92
java-version : ' 18'
93
93
distribution : ' adopt'
94
+
94
95
- uses : actions/setup-go@v4
96
+ if : matrix.lang == 'go'
95
97
with :
96
98
go-version : ' 1.20'
97
99
- uses : acifani/setup-tinygo@v2
100
+ if : matrix.lang == 'go'
98
101
with :
99
102
tinygo-version : 0.31.0
100
- - name : cargo test --workspace
101
- run : cargo test --workspace
103
+
104
+ - run : |
105
+ cargo test \
106
+ -p wit-bindgen-cli \
107
+ -p wit-bindgen-${{ matrix.lang }} \
108
+ --no-default-features \
109
+ --features ${{ matrix.lang }}
110
+
111
+ test_unit :
112
+ name : Crate Unit Tests
113
+ runs-on : ubuntu-latest
114
+ steps :
115
+ - uses : actions/checkout@v4
116
+ with :
117
+ submodules : true
118
+ - name : Install Rust
119
+ run : rustup update stable --no-self-update && rustup default stable
120
+ - run : rustup target add wasm32-wasip1
121
+ - run : cargo test -p wit-bindgen-core
122
+ - run : cargo test -p wit-bindgen
123
+ - run : cargo test --workspace --exclude 'wit-bindgen*'
102
124
103
125
check :
104
126
name : Check
@@ -109,8 +131,8 @@ jobs:
109
131
run : rustup update stable --no-self-update && rustup default stable
110
132
- name : Install wasm32-unknown-unknown target
111
133
run : rustup target add wasm32-unknown-unknown
112
- - name : Install wasm32-wasi target
113
- run : rustup target add wasm32-wasi
134
+ - name : Install wasm32-wasip1 target
135
+ run : rustup target add wasm32-wasip1
114
136
115
137
# Verify the output of the `./ci/rebuild-libcabi-realloc.sh` script is
116
138
# up-to-date.
@@ -129,10 +151,10 @@ jobs:
129
151
- run : cargo build --no-default-features --features markdown
130
152
131
153
# Feature combos of the `wit-bindgen` crate
132
- - run : cargo build --target wasm32-wasi -p wit-bindgen --no-default-features
133
- - run : cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features realloc
134
- - run : cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros
135
- - run : cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros,realloc
154
+ - run : cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features
155
+ - run : cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features realloc
156
+ - run : cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features macros
157
+ - run : cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features macros,realloc
136
158
137
159
# Verity that documentation can be generated for the rust bindings crate.
138
160
- run : cargo doc -p wit-bindgen --no-deps
@@ -169,6 +191,7 @@ jobs:
169
191
runs-on : ubuntu-latest
170
192
needs :
171
193
- test
194
+ - test_unit
172
195
- rustfmt
173
196
- build
174
197
- verify-publish
0 commit comments