Skip to content

Commit 4dec802

Browse files
authored
Merge pull request #2054 from CosmWasm/aw/core-crate
Create `cosmwasm-core` crate
2 parents 31c34b3 + 026040e commit 4dec802

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2054
-1713
lines changed

.circleci/config.yml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ workflows:
6565
- arm64
6666
- package_crypto
6767
- package_check
68+
- package_core
6869
- package_schema
6970
- package_schema_derive
7071
- package_std
@@ -171,6 +172,10 @@ jobs:
171172
name: "contracts/staking: integration-test"
172173
working_directory: ~/project/contracts/staking
173174
command: cargo wasm --locked && cargo integration-test --locked
175+
- run:
176+
name: "packages/core: test"
177+
working_directory: ~/project/packages/core
178+
command: cargo test --all-features --locked
174179
- run:
175180
name: "packages/crypto: test"
176181
working_directory: ~/project/packages/crypto
@@ -285,6 +290,62 @@ jobs:
285290
- target/debug/deps
286291
key: cargocache-v2-package_check-rust:1.73-{{ checksum "Cargo.lock" }}
287292

293+
package_core:
294+
docker:
295+
- image: rust:1.73
296+
environment:
297+
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
298+
RUST_TEST_THREADS: 8
299+
steps:
300+
- checkout
301+
- run:
302+
name: Version information
303+
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
304+
- restore_cache:
305+
keys:
306+
- cargocache-v2-package_core-rust:1.73-{{ checksum "Cargo.lock" }}
307+
- run:
308+
name: Add thumbv7em-none-eabi target
309+
command: rustup target add thumbv7em-none-eabi && rustup target list --installed
310+
- run:
311+
name: Add wasm32 target
312+
command: rustup target add wasm32-unknown-unknown && rustup target list --installed
313+
- run:
314+
name: Build library for native target (no features)
315+
working_directory: ~/project/packages/core
316+
command: cargo build --locked --no-default-features
317+
- run:
318+
name: Build library for wasm target (no features)
319+
working_directory: ~/project/packages/core
320+
command: cargo wasm --locked --no-default-features
321+
- run:
322+
name: Build library for no_std target (no features)
323+
working_directory: ~/project/packages/core
324+
command: cargo no-std --locked --no-default-features
325+
- run:
326+
name: Run unit tests (no features)
327+
working_directory: ~/project/packages/core
328+
command: cargo test --locked --no-default-features
329+
- run:
330+
name: Build library for native target (all features)
331+
working_directory: ~/project/packages/core
332+
command: cargo build --locked --features std
333+
- run:
334+
name: Build library for wasm target (all features)
335+
working_directory: ~/project/packages/core
336+
command: cargo wasm --locked --features std
337+
- run:
338+
name: Run unit tests (all features)
339+
working_directory: ~/project/packages/core
340+
command: cargo test --locked --features std
341+
- save_cache:
342+
paths:
343+
- /usr/local/cargo/registry
344+
- target/debug/.fingerprint
345+
- target/debug/build
346+
- target/debug/deps
347+
key: cargocache-v2-package_core-rust:1.73-{{ checksum "Cargo.lock" }}
348+
288349
package_schema:
289350
docker:
290351
- image: rust:1.73
@@ -925,6 +986,14 @@ jobs:
925986
name: Clippy linting on schema-derive
926987
working_directory: ~/project/packages/schema-derive
927988
command: cargo clippy --all-targets --tests -- -D warnings
989+
- run:
990+
name: Clippy linting on core (no feature flags)
991+
working_directory: ~/project/packages/core
992+
command: cargo clippy --all-targets -- -D warnings
993+
- run:
994+
name: Clippy linting on core (all feature flags)
995+
working_directory: ~/project/packages/core
996+
command: cargo clippy --all-features --all-targets -- -D warnings
928997
- run:
929998
name: Clippy linting on std (no feature flags)
930999
working_directory: ~/project/packages/std
@@ -997,8 +1066,9 @@ jobs:
9971066
name: Run tests with coverage
9981067
command: |
9991068
mkdir -p reports
1000-
cargo test
1069+
cargo test --all-features
10011070
1071+
grcov . -s packages/core --binary-path ./target/debug -t lcov -o ./reports/core.info
10021072
grcov . -s packages/crypto --binary-path ./target/debug -t lcov -o ./reports/crypto.info
10031073
grcov . -s packages/derive --binary-path ./target/debug -t lcov -o ./reports/derive.info
10041074
grcov . -s packages/schema --binary-path ./target/debug -t lcov -o ./reports/schema.info
@@ -1007,6 +1077,9 @@ jobs:
10071077
environment:
10081078
RUSTFLAGS: "-Cinstrument-coverage"
10091079
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
1080+
- codecov/upload:
1081+
file: reports/core.info
1082+
flags: cosmwasm-core
10101083
- codecov/upload:
10111084
file: reports/crypto.info
10121085
flags: cosmwasm-crypto

0 commit comments

Comments
 (0)