Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Update workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Dec 20, 2023
1 parent 16f580b commit 3711481
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
with:
cache: false
components: rustfmt
- run: cargo fmt --all --check
lint:
Expand All @@ -31,6 +32,7 @@ jobs:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
with:
cache: false
components: clippy
- run: cargo clippy --workspace --all-targets
test:
Expand All @@ -44,7 +46,10 @@ jobs:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-wasi, cargo-nextest
bins: cargo-nextest
cache: false
- run: cargo wasi build
- run: cargo nextest run
- uses: moonrepo/setup-toolchain@v0
with:
proto-version: 0.26.0-rc.2
- uses: moonrepo/build-proto-plugin@v0
- run: cargo nextest run --no-default-features
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- uses: moonrepo/setup-rust@v1
with:
cache: false
targets: wasm32-wasi
- uses: moonrepo/build-proto-plugin@v0
- if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: ncipollo/release-action@v1
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ proto_pdk_test_utils = { version = "0.14.4" } # , path = "../../proto/crat
starbase_sandbox = "0.1.12"
tokio = { version = "1.35.1", features = ["full"] }

[features]
default = ["wasm"]
wasm = []

[profile.release]
codegen-units = 1
debug = false
Expand Down
13 changes: 4 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
mod toolchain_toml;

// WASM cannot be executed through the test runner and we need to avoid building
// WASM code for non-WASM targets. We can solve both of these with a cfg flag.

#[cfg(not(test))]
#[cfg(feature = "wasm")]
mod helpers;

#[cfg(not(test))]
#[cfg(feature = "wasm")]
mod proto;
mod toolchain_toml;

#[cfg(not(test))]
#[cfg(feature = "wasm")]
pub use proto::*;

0 comments on commit 3711481

Please sign in to comment.