Skip to content

Commit 3f703b2

Browse files
committed
Merge with upstream
2 parents 29689f7 + 749bacc commit 3f703b2

File tree

22 files changed

+242
-274
lines changed

22 files changed

+242
-274
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ jobs:
5858
fail-fast: false
5959
matrix:
6060
os: [ubuntu-latest, macos-latest, windows-latest]
61+
lang: [c, rust, teavm-java, go, csharp]
6162
runs-on: ${{ matrix.os }}
6263
steps:
6364
- uses: actions/checkout@v4
6465
with:
6566
submodules: true
6667
- name: Install Rust
6768
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'
7273

7374
- uses: ./.github/actions/install-wasi-sdk
75+
if: matrix.lang == 'c' || (matrix.lang == 'csharp' && matrix.os == 'windows-latest')
7476

7577
- run: |
7678
curl.exe -LO https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
@@ -80,25 +82,45 @@ jobs:
8082
echo $LOCALAPPDATA'\Microsoft\dotnet' >> $GITHUB_PATH
8183
echo $LOCALAPPDATA'\Microsoft\dotnet\tools' >> $GITHUB_PATH
8284
$LOCALAPPDATA/Microsoft/dotnet/dotnet --info
83-
if : matrix.os == 'windows-latest'
85+
if: matrix.os == 'windows-latest' && matrix.lang == 'csharp'
8486
8587
- run: ci/download-teavm.sh
86-
87-
- uses: actions/setup-node@v4
88-
with:
89-
node-version: '16'
88+
if: matrix.lang == 'teavm-java'
9089
- uses: actions/setup-java@v4
90+
if: matrix.lang == 'teavm-java'
9191
with:
9292
java-version: '18'
9393
distribution: 'adopt'
94+
9495
- uses: actions/setup-go@v4
96+
if: matrix.lang == 'go'
9597
with:
9698
go-version: '1.20'
9799
- uses: acifani/setup-tinygo@v2
100+
if: matrix.lang == 'go'
98101
with:
99102
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*'
102124

103125
check:
104126
name: Check
@@ -109,8 +131,8 @@ jobs:
109131
run: rustup update stable --no-self-update && rustup default stable
110132
- name: Install wasm32-unknown-unknown target
111133
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
114136

115137
# Verify the output of the `./ci/rebuild-libcabi-realloc.sh` script is
116138
# up-to-date.
@@ -129,10 +151,10 @@ jobs:
129151
- run: cargo build --no-default-features --features markdown
130152

131153
# 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
136158

137159
# Verity that documentation can be generated for the rust bindings crate.
138160
- run: cargo doc -p wit-bindgen --no-deps
@@ -169,6 +191,7 @@ jobs:
169191
runs-on: ubuntu-latest
170192
needs:
171193
- test
194+
- test_unit
172195
- rustfmt
173196
- build
174197
- verify-publish

0 commit comments

Comments
 (0)