From b7dd0f5c88d9044b910037dd9ee1d689438e567a Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Thu, 26 Dec 2024 01:53:44 +0800 Subject: [PATCH] Add inspect action --- action/build/action.yml | 14 ++++---------- action/inspect.yml/action.yml | 32 ++++++++++++++++++++++++++++++++ action/override/action.yml | 4 ++-- action/try-runtime/action.yml | 4 ++-- 4 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 action/inspect.yml/action.yml diff --git a/action/build/action.yml b/action/build/action.yml index 681b733..7e1475f 100644 --- a/action/build/action.yml +++ b/action/build/action.yml @@ -6,10 +6,10 @@ branding: inputs: runtime: - description: "Target runtime crate to build." + description: "Target runtime to build." required: true features: - description: "Features to enable for the runtime crate." + description: "Features to enable for the runtime." required: false toolchain-ver: description: "Rust toolchain version to use. Default is reading `rust-toolchain.toml` or `stable`." @@ -32,10 +32,10 @@ runs: chmod u+x prr && mv prr /usr/local/bin/prr - name: Build runtime - id: build shell: bash run: | CMD="prr build ${{ inputs.runtime }}" + if [ ! -z "${{ inputs.features }}" ]; then CMD="$CMD -f ${{ inputs.features }}" fi @@ -49,10 +49,4 @@ runs: CMD="$CMD -o ${{ inputs.output-dir }}" fi - RESULT=$(${CMD}) - echo "result=${RESULT}" >> "$GITHUB_OUTPUT" - -outputs: - result: - description: "Build result." - value: ${{ steps.build.outputs.result }} + eval $CMD diff --git a/action/inspect.yml/action.yml b/action/inspect.yml/action.yml new file mode 100644 index 0000000..ca6ab97 --- /dev/null +++ b/action/inspect.yml/action.yml @@ -0,0 +1,32 @@ +name: "Polkadot Runtime Releaser Inspect Action" +description: "Polkadot Runtime Releaser Inspect Action." +branding: + icon: "check-circle" + color: "blue" + +inputs: + runtime: + description: "Target runtime to inspect." + required: true + +runs: + using: "composite" + steps: + - name: Setup Polkadot Runtime Releaser + shell: bash + run: curl + -L https://github.com/hack-ink/polkadot-runtime-releaser/releases/download/v0.1.7/prr-x86_64-unknown-linux-gnu.tar.gz | + tar xz && + chmod u+x prr && + mv prr /usr/local/bin/prr + - name: Inspect runtime + id: inspect + shell: bash + run: | + RESULT=$(prr inspect --runtime ${{ inputs.runtime }}) + echo "result=${RESULT}" >> "$GITHUB_OUTPUT" + +outputs: + result: + description: "Inspect result." + value: ${{ steps.inspect.outputs.result }} diff --git a/action/override/action.yml b/action/override/action.yml index 54ad7ee..f4a9a81 100644 --- a/action/override/action.yml +++ b/action/override/action.yml @@ -12,10 +12,10 @@ inputs: description: "Branch, tag, or commit of the runtime repository to fetch." required: true runtime: - description: "Target runtime crate to build." + description: "Target runtime to build." required: true features: - description: "Features to enable for the runtime crate." + description: "Features to enable for the runtime." required: true toolchain-ver: description: "Rust toolchain version to use." diff --git a/action/try-runtime/action.yml b/action/try-runtime/action.yml index ae47f89..bc4f3c4 100644 --- a/action/try-runtime/action.yml +++ b/action/try-runtime/action.yml @@ -6,10 +6,10 @@ branding: inputs: runtime: - description: "Target runtime crate to build." + description: "Target runtime to build." required: true features: - description: "Features to enable for the runtime crate." + description: "Features to enable for the runtime." required: false toolchain-ver: description: "Rust toolchain version to use."