Skip to content

Commit

Permalink
Update to default to 2 second block times (#20)
Browse files Browse the repository at this point in the history
* Update to default to 2 second block times

* Update Cargo.toml

* Update Cargo.lock

* Make the spec version match.

* Fix CircleCI cache.

* Pin to Polymesh Public version.

---------

Co-authored-by: Robert G. Jakabosky <rjakabosky+neopallium@neoawareness.com>
  • Loading branch information
adamdossa and Neopallium authored Apr 10, 2024
1 parent 5921889 commit fd00897
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 144 deletions.
75 changes: 20 additions & 55 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ commands:
/usr/local/cargo/bin/sccache --version
restore-sccache-cache:
steps:
- run:
name: Store rust version in a file for cache key
command: rustc --version > rust.version
- restore_cache:
name: Restore sccache cache
key: sccache-cache-stable-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
key: sccache-cache-stable-v2-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- run:
name: Show cache size
command: /usr/local/cargo/bin/sccache -s
Expand All @@ -29,7 +32,7 @@ commands:
# Of course, restore_cache will not find this exact key,
# but it will fall back to the closest key (aka the most recent).
# See https://discuss.circleci.com/t/add-mechanism-to-update-existing-cache-key/9014/13
key: sccache-cache-stable-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
key: sccache-cache-stable-v2-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
paths:
- "/usr/local/cargo"
- "~/.cache/sccache"
Expand Down Expand Up @@ -69,12 +72,8 @@ jobs:
RUSTC_WRAPPER: /usr/local/cargo/bin/sccache
steps:
- checkout
- run:
name: Store rust version in an environment var for cache key
command: rustc --version > rust.version
- restore_cache:
keys:
- v7-release-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
- setup-sccache
- restore-sccache-cache
- run:
name: Build release
command: cargo build --locked --release
Expand Down Expand Up @@ -104,11 +103,7 @@ jobs:
root: ./assets
paths:
- .
- save_cache:
key: v7-release-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
- "/usr/local/cargo"
- "~/.cache/sccache"
- save-sccache-cache
benchmark-build:
docker:
- image: polymeshassociation/rust:debian-nightly-2023-12-11
Expand All @@ -119,12 +114,8 @@ jobs:
RUSTC_WRAPPER: /usr/local/cargo/bin/sccache
steps:
- checkout
- run:
name: Store rust version in an environment var for cache key
command: rustc --version > rust.version
- restore_cache:
keys:
- v4-bench-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
- setup-sccache
- restore-sccache-cache
- run:
name: Build binary with runtime-benchmarks
command: cargo build --locked --release --features=runtime-benchmarks,running-ci
Expand All @@ -136,11 +127,7 @@ jobs:
root: ./
paths:
- polymesh-private-benchmarks
- save_cache:
key: v4-bench-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
- "/usr/local/cargo"
- "~/.cache/sccache"
- save-sccache-cache
benchmark:
docker:
- image: debian:stable
Expand All @@ -166,23 +153,15 @@ jobs:
RUST_BACKTRACE: "1"
steps:
- checkout
- run:
name: Store rust version in a file for cache key
command: rustc --version > rust.version
- restore_cache:
keys:
- v12-test-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
- setup-sccache
- restore-sccache-cache
- run:
name: Tests
command: >-
cargo test
--package polymesh-private-runtime-tests
no_output_timeout: 30m
- save_cache:
key: v12-test-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
- "/usr/local/cargo"
- "~/.cache/sccache"
- save-sccache-cache
coverage:
docker:
- image: polymeshassociation/rust:debian-nightly-2023-12-11
Expand All @@ -191,20 +170,13 @@ jobs:
VERBOSE: "1"
steps:
- checkout
- run:
name: Store rust version in a file for cache key
command: rustc --version | tee rust.version
- restore_cache:
keys:
- v7-coverage-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
- setup-sccache
- restore-sccache-cache
- run:
name: Coverage
command: bash ./scripts/coverage.sh
no_output_timeout: 30m
- save_cache:
key: v7-coverage-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
- "/usr/local/cargo"
- save-sccache-cache
rust-integration-test:
docker:
- image: polymeshassociation/rust:debian-nightly-2023-12-11
Expand Down Expand Up @@ -245,20 +217,13 @@ jobs:
SKIP_WASM_BUILD: "1"
steps:
- checkout
- run:
name: Store rust version in a file for cache key
command: rustc --version > rust.version
- restore_cache:
keys:
- v6-clippy-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
- setup-sccache
- restore-sccache-cache
- run:
name: run clippy
command: cargo clippy -- -A clippy::all -W clippy::complexity -W clippy::perf
no_output_timeout: 30m
- save_cache:
key: v6-clippy-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
- "/usr/local/cargo"
- save-sccache-cache
build-docker-debian:
environment:
IMAGE_NAME: polymeshassociation/polymesh-private
Expand Down
Loading

0 comments on commit fd00897

Please sign in to comment.