Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing try runtime install #1883

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:
issue_comment:
types: [created]
pull_request:
types: [labeled]
paths:
- '**.rs'
- .github/workflows/try-runtime.yml
jobs:
try-runtime:
Expand All @@ -17,19 +15,28 @@ jobs:
strategy:
fail-fast: false
matrix:
chain: [altair, centrifuge]
chain: [altair, centrifuge, demo]
if: >
github.event_name == 'schedule' ||
contains(github.event.pull_request.labels.*.name, 'D8-migration') ||
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '/try-runtime') &&
github.event.issue.pull_request != '')

runs-on: ubuntu-latest-4-cores
name: "${{ matrix.chain }}"
steps:
- name: Check out code
- name: Check out code (Pull Request)
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2
with:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'issue_comment' || github.event_name == 'pull_request'

- name: Check out code (main)
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2
with:
ref: 'refs/heads/main'
if: github.event_name == 'schedule'

- name: Get PR author and commenter
id: get-users
Expand All @@ -40,9 +47,11 @@ jobs:
echo "::set-output name=pr_author::$PR_AUTHOR"
echo "::set-output name=comment_author::$COMMENT_AUTHOR"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}

- name: Check if commenter is PR author and a repo contributor
env:
GITHUB_TOKEN: ${{ github.token }}
if: >
steps.get-users.outputs.pr_author == steps.get-users.outputs.comment_author &&
github.event_name == 'issue_comment'
Expand All @@ -68,7 +77,7 @@ jobs:
# - name: Install try-runtime-cli
# run: cargo install --git https://github.com/paritytech/try-runtime-cli --tag v0.5.4 --locked
- name: cargo build
run: ./ci/run-check.sh -F try-runtime
run: ./ci/run-check.sh --features try-runtime
env:
TARGET: cargo-build
RUSTC_WRAPPER: "sccache"
Expand Down
22 changes: 19 additions & 3 deletions ci/run-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,35 @@ case $TARGET in
;;

try-runtime)
cargo build -p centrifuge-chain --release --features try-runtime
echo "Contents of target/release/wbuild/:"
ls -l target/release/wbuild/
echo "Contents of subdirectories in target/release/wbuild/:"
ls -l target/release/wbuild/*/
# Check if try-runtime is available
if ! command try-runtime --version &> /dev/null
then
echo "try-runtime could not be found, trying 'cargo install try-runtime-cli'"
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.7.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
fi
if [ "$1" == "altair" ]; then
echo "Running try-runtime for altair"
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
try-runtime \
./try-runtime \
--runtime target/release/wbuild/altair-runtime/altair_runtime.wasm \
on-runtime-upgrade live --uri wss://fullnode.altair.centrifuge.io:443
elif [ "$1" == "centrifuge" ]; then
echo "Running try-runtime for centrifuge"
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
try-runtime \
./try-runtime \
--runtime target/release/wbuild/centrifuge-runtime/centrifuge_runtime.wasm \
on-runtime-upgrade live --uri wss://fullnode.centrifuge.io:443
elif [ "$1" == "demo" ]; then
echo "Running try-runtime for demo env"
RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \
./try-runtime \
--runtime target/release/wbuild/development-runtime/development_runtime.wasm \
on-runtime-upgrade live --uri wss://fullnode-query.demo.k-f.dev:443 # fullnode.demo.k-f.dev is throtlled and thus it might fail
else
echo "Invalid argument. Please specify 'altair' or 'centrifuge'."
exit 1
Expand Down
Loading