Skip to content

fix: chainspec irregularities #10

fix: chainspec irregularities

fix: chainspec irregularities #10

Workflow file for this run

name: Check Chainspec
concurrency:
group: check-chainspec-${{ github.ref }}
cancel-in-progress: true
on:
## Run automatically for all PRs against main, regardless of what the changes are
## to be safe and so we can more easily force re-run the CI when github is being
## weird by using a blank commit
push:
branches: [main, development, staging]
##
# Run automatically for PRs against default/main branch if Rust files change
pull_request:
branches: [main, development, staging]
## Allow running workflow manually from the Actions tab
workflow_dispatch:
inputs:
verbose:
description: "Output more information when triggered manually"
required: false
default: ""
env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}
jobs:
check-chainspecs:
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
os:
- ubuntu-latest
include:
- os: ubuntu-latest
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal
- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
- name: Build chainspecs
run: |
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-05-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-03-05-x86_64-unknown-linux-gnu
./scripts/build_all_chainspecs.sh
- name: Check raw_spec_finney.json
run: |
sha1=$(sha256sum __CI_TESTING__raw_spec_finney.json | awk '{print $1}')
sha2=$(sha256sum raw_spec_finney.json | awk '{print $1}')
echo "__CI_TESTING__raw_spec_finney.json SHA256: $sha1"
echo "raw_spec_finney.json SHA256: $sha2"
if [ "$sha1" != "$sha2" ]; then
echo "raw_spec_finney.json needs to be updated."
exit 1
else
echo "raw_spec_finney.json is up to date."
fi
# - name: Check plain_spec_finney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__plain_spec_finney.json | awk '{print $1}')" != "$(sha256sum plain_spec_finney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__plain_spec_finney.json plain_spec_finney.json || true
# echo "plain_spec_finney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'."
# exit 1
# else
# echo "plain_spec_finney.json is up to date."
# fi
#
# - name: Check raw_spec_testfinney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__raw_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum raw_spec_testfinney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__raw_spec_testfinney.json raw_spec_testfinney.json || true
# echo "raw_spec_testfinney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'"
# exit 1
# else
# echo "raw_spec_testfinney.json is up to date."
# fi
#
# - name: Check plain_spec_testfinney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__plain_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum plain_spec_testfinney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__plain_spec_testfinney.json plain_spec_testfinney.json || true
# echo "plain_spec_testfinney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'"
# exit 1
# else
# echo "plain_spec_testfinney.json is up to date."
# fi