Skip to content

Commit 5598ed9

Browse files
tomakagavofyork
authored andcommitted
Add WASM CI checks and make availability-store compile for WASM (paritytech#626)
* Make availability-store compile for WASM * Use --manifest-path instead
1 parent 6eb9c71 commit 5598ed9

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.gitlab-ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ variables:
4040
.docker-env: &docker-env
4141
retry:
4242
max: 2
43-
when:
43+
when:
4444
- runner_system_failure
4545
- unknown_failure
4646
- api_failure
@@ -131,6 +131,23 @@ test-linux-stable: &test
131131
- sccache -s
132132

133133

134+
check-web-wasm: &test
135+
stage: test
136+
<<: *test-refs
137+
<<: *docker-env
138+
<<: *compiler_info
139+
script:
140+
# WASM support is in progress. As more and more crates support WASM, we
141+
# should add entries here. See https://github.com/paritytech/polkadot/issues/625
142+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path availability-store/Cargo.toml
143+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path executor/Cargo.toml
144+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path erasure-coding/Cargo.toml
145+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path parachain/Cargo.toml
146+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path primitives/Cargo.toml
147+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path rpc/Cargo.toml
148+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path runtime/Cargo.toml
149+
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path statement-table/Cargo.toml
150+
- sccache -s
134151

135152

136153
build-linux-release: &build
@@ -209,7 +226,7 @@ publish-docker-release:
209226
- docker build
210227
--build-arg VCS_REF="${CI_COMMIT_SHA}"
211228
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
212-
--tag $CONTAINER_IMAGE:$VERSION
229+
--tag $CONTAINER_IMAGE:$VERSION
213230
--tag $CONTAINER_IMAGE:$EXTRATAG .
214231
- docker push $CONTAINER_IMAGE:$VERSION
215232
- docker push $CONTAINER_IMAGE:$EXTRATAG

availability-store/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ log = "0.4.8"
1212
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
1313
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
1414
kvdb = "0.1.1"
15-
kvdb-rocksdb = "0.2"
1615
kvdb-memorydb = "0.1.2"
16+
17+
[target.'cfg(not(target_os = "unknown"))'.dependencies]
18+
kvdb-rocksdb = "0.2"

availability-store/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
2323
use codec::{Encode, Decode};
2424
use kvdb::{KeyValueDB, DBTransaction};
25-
use kvdb_rocksdb::{Database, DatabaseConfig};
2625
use polkadot_primitives::Hash;
2726
use polkadot_primitives::parachain::{Id as ParaId, BlockData, Message};
2827
use log::warn;
@@ -74,7 +73,9 @@ pub struct Store {
7473

7574
impl Store {
7675
/// Create a new `Store` with given config on disk.
76+
#[cfg(not(target_os = "unknown"))]
7777
pub fn new(config: Config) -> io::Result<Self> {
78+
use kvdb_rocksdb::{Database, DatabaseConfig};
7879
let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS));
7980

8081
if let Some(cache_size) = config.cache_size {

0 commit comments

Comments
 (0)