From 8638dcfb3b8a587fc2a2ff67eea1b875c1458094 Mon Sep 17 00:00:00 2001 From: meskill <8974488+meskill@users.noreply.github.com> Date: Mon, 24 Apr 2023 20:06:32 +0000 Subject: [PATCH] ci: add docs.ts test builds For only the packages with specific set of features for docs.rs building --- .github/workflows/test.yaml | 9 +++++---- Makefile | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ee970beabe6..69982941455 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -128,8 +128,8 @@ jobs: - name: make build-wasmer-wasm run: make build-wasmer-wasm - test_build_docs_api: - name: Test build docs api + test_build_docs_rs: + name: Test build docs rs runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -137,8 +137,9 @@ jobs: with: toolchain: 1.65 target: x86_64-unknown-linux-gnu - - name: make build-docs-api - run: make build-docs-api + - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` + - name: make test-build-docs-rs + run: make test-build-docs-rs build_linux_aarch64: name: ${{ matrix.build-what.name }} on linux-aarch64 diff --git a/Makefile b/Makefile index bf879d49add..ebc07c36c41 100644 --- a/Makefile +++ b/Makefile @@ -440,8 +440,20 @@ endif build-docs: $(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --release $(compiler_features) --document-private-items --no-deps --workspace --exclude wasmer-c-api -build-docs-api: - $(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --release $(compiler_features) --manifest-path lib/api/Cargo.toml --features compiler,core,cranelift,engine,jit,singlepass,static-artifact-create,static-artifact-load,sys,sys-default,wasmer-artifact-create,wasmer-artifact-load +test-build-docs-rs: + manifest_docs_rs_features_path="package.metadata.docs.rs.features" + + for manifest_path in lib/*/Cargo.toml; do + toml get $manifest_path $manifest_docs_rs_features_path &> /dev/null + + if [ $? -ne 0 ]; then + continue + fi + + features=$(toml get $manifest_path $manifest_docs_rs_features_path | sed 's/\[//; s/\]//; s/"\([^"]*\)"/\1/g') + + $(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --release $(compiler_features) --manifest-path $manifest_path --features $features + done; build-docs-capi: # `wasmer-c-api` lib's name is `wasmer`. To avoid a conflict