forked from paritytech/try-runtime-gha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
79 lines (68 loc) · 2.67 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "Try Runtime GHA"
description: "Easily check runtime migrations for a Substrate-based blockchain using try-runtime-cli"
author: "Parity Tech"
branding:
icon: "shield"
color: "green"
inputs:
runtime-package:
description: "The runtime package name"
required: true
node-uri:
description: "URI of a node to scrape state"
required: true
extra-args:
description: 'Extra args to pass to the ''on-runtime-upgrade'' subcommand. For example, "--disable-idempotency-check --no-weight-warnings". See all options at https://paritytech.github.io/try-runtime-cli/try_runtime_core/commands/on_runtime_upgrade/struct.Command.html.'
default: ""
checks:
description: 'Types of checks to run. For example, "pre-and-post". See all options at https://paritytech.github.io/try-runtime-cli/frame_support/traits/enum.UpgradeCheckSelect.html.'
default: "all"
shared-cache-key:
description: "The shared cache key"
default: "try-runtime-gha"
runs:
using: "composite"
steps:
- name: Download try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
mv try-runtime parachain
shell: bash
- name: Install Protoc
uses: arduino/[email protected]
with:
version: "3.6.1"
- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
shell: bash
- name: Add rust-src component
run: rustup component add rust-src
shell: bash
- name: Fetch cache
uses: Swatinem/[email protected]
with:
shared-key: ${{ inputs.shared-cache-key }}
- name: Build ${{ inputs.runtime-name }}
run: |
cd parachain
cargo build --profile production -p ${{ inputs.runtime-package }} --features try-runtime -q --locked
shell: bash
- name: Check migrations
run: |
cd parachain
PACKAGE_NAME=${{ inputs.runtime-package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
export RUST_LOG=remote-ext=debug,runtime=debug
# Store the command in a variable so we can log it
COMMAND="./try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --disable-mbm-checks --blocktime 12000000 \
${{ inputs.extra-args }} \
live --uri ${{ inputs.node-uri }}"
# Echo the command before running it, for debugging purposes
echo "Running command:"
echo "$COMMAND"
eval "$COMMAND"
shell: bash