Skip to content

Commit

Permalink
Fix Subxt CI (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded authored Feb 15, 2024
1 parent 74ab3a3 commit 7c86c43
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 376 deletions.
117 changes: 101 additions & 16 deletions .github/workflows/subxt-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,122 @@ name: Subxt Diff
on:
workflow_dispatch:
inputs:
last_release_sha8:
description: The sha8 of the last release, with which to compare local to.
required: true
spec_version:
description: runtime spec version (ex. 1601)
required: true

jobs:
build:
runs-on:
labels: bare-metal
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Local build new Node
uses: ./.github/workflow-templates/cargo-build
- name: Upload Node
uses: actions/upload-artifact@v4
with:
name: moonbeam
path: build

local-diff:
runs-on: ubuntu-latest
needs: build
runs-on: bare-metal
strategy:
matrix:
runtime: [moonbeam, moonbase, moonriver]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
uses: actions/checkout@v4
- name: Download Node
uses: actions/download-artifact@v4
with:
version: 8.6.12
name: moonbeam
path: build
- name: Install Subxt-cli
run: |
cargo install subxt-cli
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.0
cache: "pnpm"
cache-dependency-path: test/pnpm-lock.yaml
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run last_release node via Docker
run: |
docker pull moonbeamfoundation/moonbeam:sha-${{ github.event.inputs.last_release_sha8 }}
docker run -d --name moonbeam_container -p 9911:9911 moonbeamfoundation/moonbeam:sha-${{ github.event.inputs.last_release_sha8 }} \
--chain=${{ matrix.runtime }}-dev \
--no-hardware-benchmarks \
--no-telemetry \
--reserved-only \
--rpc-cors=all \
--no-grandpa \
--sealing=manual \
--force-authoring \
--no-prometheus \
--unsafe-rpc-external \
--alice \
--rpc-port=9911 \
--tmp
sleep 2
- name: Run Local Node
run: |
chmod +x build/moonbeam
nohup sh -c './build/moonbeam \
--chain=${{ matrix.runtime }}-dev \
--no-hardware-benchmarks \
--no-telemetry \
--reserved-only \
--rpc-cors=all \
--no-grandpa \
--sealing=manual \
--force-authoring \
--no-prometheus \
--unsafe-rpc-external \
--alice \
--rpc-port=9977 \
--tmp & sleep 2' &
- name: Run Diffs
run: |
cd test
pnpm install
mkdir -p runtime-diffs/${{ matrix.runtime }}
subxt diff -a ws://127.0.0.1:9911 ws://127.0.0.1:9977 | sed 's/\x1b\[[0-9;]*m//g' > runtime-diffs/${{ matrix.runtime }}/${{ github.event.inputs.spec_version }}.txt
- name: Stop Node Services
if: always()
run: |
docker stop moonbeam_container
docker rm moonbeam_container
pkill moonbeam
pnpm tsx scripts/subxt-diff.ts diff moonbase true
pnpm tsx scripts/subxt-diff.ts diff moonriver true
pnpm tsx scripts/subxt-diff.ts diff moonbeam true
- name: Upload diff artifacts
uses: actions/upload-artifact@v4
with:
name: runtime-diff-${{ matrix.runtime }}-${{ github.event.inputs.spec_version }}
path: runtime-diffs/${{ matrix.runtime }}

create_pr:
needs: local-diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Download artifacts from the local-diff job
- name: Download diff artifacts
uses: actions/download-artifact@v4
with:
name: runtime-diff-moonbase-${{ github.event.inputs.spec_version }}
path: runtime-diffs/moonbase
- name: Download diff artifacts
uses: actions/download-artifact@v4
with:
name: runtime-diff-moonbeam-${{ github.event.inputs.spec_version }}
path: runtime-diffs/moonbeam
- name: Download diff artifacts
uses: actions/download-artifact@v4
with:
name: runtime-diff-moonriver-${{ github.event.inputs.spec_version }}
path: runtime-diffs/moonriver
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
Expand Down
3 changes: 1 addition & 2 deletions precompiles/xcm-utils/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use sp_core::{H256, U256};
use sp_io;
use sp_runtime::traits::{BlakeTwo256, IdentityLookup, TryConvert};
use sp_runtime::BuildStorage;
use sp_std::borrow::Borrow;
use xcm::latest::Error as XcmError;
use xcm_builder::AllowUnpaidExecutionFrom;
use xcm_builder::FixedWeightBounds;
Expand Down Expand Up @@ -109,7 +108,7 @@ impl ConvertLocation<AccountId> for MockParentMultilocationToAccountConverter {
pub struct MockParachainMultilocationToAccountConverter;
impl ConvertLocation<AccountId> for MockParachainMultilocationToAccountConverter {
fn convert_location(location: &MultiLocation) -> Option<AccountId> {
match location.borrow() {
match location {
MultiLocation {
parents: 1,
interior: Junctions::X1(Parachain(id)),
Expand Down
2 changes: 0 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@vitest/ui": "1.2.2",
"@zombienet/utils": "0.0.24",
"chalk": "5.3.0",
"dockerode": "^4.0.2",
"eth-object": "github:aurora-is-near/eth-object#master",
"ethers": "6.10.0",
"json-bigint": "1.0.0",
Expand All @@ -55,7 +54,6 @@
},
"devDependencies": {
"@types/debug": "4.1.12",
"@types/dockerode": "^3.3.23",
"@types/json-bigint": "^1.0.4",
"@types/node": "20.11.16",
"@types/semver": "7.5.6",
Expand Down
102 changes: 1 addition & 101 deletions test/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c86c43

Please sign in to comment.