Skip to content
Snippets Groups Projects
Commit 810c391d authored by gabriel klawitter's avatar gabriel klawitter Committed by Gav Wood
Browse files

check spec_version and impl_version (#1743)

parent e5dbcf68
No related merge requests found
......@@ -13,6 +13,7 @@ git log --graph --oneline --decorate=short -n 10
RUNTIME="node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"
VERSIONS_FILE="node/runtime/src/lib.rs"
......@@ -31,28 +32,33 @@ fi
# check for spec_version updates
add_spec_version="$(git diff origin/master...${CI_COMMIT_SHA} node/runtime/src/lib.rs \
| sed -n -r 's/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p')"
sub_spec_version="$(git diff origin/master...${CI_COMMIT_SHA} node/runtime/src/lib.rs \
| sed -n -r 's/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p')"
# see if the spec version and the binary blob changed
if git diff --name-only origin/master...${CI_COMMIT_SHA} \
| grep -q "${RUNTIME}" && \
[ "${add_spec_version}" != "${sub_spec_version}" ]
then
cat <<-EOT
# check for version updates
for version in spec_version impl_version
do
add_version="$(git diff origin/master...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
| sed -n -r "s/^\+[[:space:]]+${version}: +([0-9]+),$/\1/p")"
sub_version="$(git diff origin/master...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
| sed -n -r "s/^\-[[:space:]]+${version}: +([0-9]+),$/\1/p")"
# see if the version and the binary blob changed
if git diff --name-only origin/master...${CI_COMMIT_SHA} \
| grep -q "${RUNTIME}" && \
[ "${add_version}" != "${sub_version}" ]
then
cat <<-EOT
changes to the runtime sources and changes in the spec version and wasm
binary blob.
${version}: ${sub_version} -> ${add_version}
changes to the runtime sources and changes in the spec version and wasm
binary blob.
EOT
exit 0
fi
done
spec_version: ${sub_spec_version} -> ${add_spec_version}
EOT
exit 0
fi
cat <<-EOT
......@@ -60,6 +66,14 @@ cat <<-EOT
wasm source files changed but not the spec version and the runtime
binary blob. This may break the api.
source file directories:
- node/src/runtime
- srml
- core/sr-*
versions file: ${VERSIONS_FILE}
EOT
echo
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment