Skip to content
Merged
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
41 changes: 10 additions & 31 deletions .github/workflow-templates/cargo-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Cargo build
description: |
Builds moonkit-template with given features.
Stores the result in "build/moonkit-template" and the runtimes in "runtimes/"

inputs:
features:
Expand All @@ -11,14 +10,19 @@ inputs:
runs:
using: "composite"
steps:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install libclang
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
- name: Setup Variables
shell: bash
run: |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_CACHE_SIZE=100GB" >> $GITHUB_ENV
# Set RUSTFLAGS if not already set
if [ -z "$RUSTFLAGS" ]; then
echo "RUSTFLAGS=-C opt-level=3 -D warnings -C linker=clang -C link-arg=-fuse-ld=$(pwd)/mold/bin/mold" >> $GITHUB_ENV
Expand All @@ -27,15 +31,10 @@ runs:
shell: bash
run: |
mkdir -p mold
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v1.1.1/mold-1.1.1-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
# With rustup's nice new toml format, we just need to run rustup show to install the toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.40.4/mold-2.40.4-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
- name: Setup Rust toolchain
shell: bash
run: |
if ! which "rustup" > /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
rustup show
- name: Build Node
shell: bash
Expand All @@ -50,23 +49,3 @@ runs:
- name: Display binary comments
shell: bash
run: readelf -p .comment ./target/release/moonkit-template
- name: Display sccache stats
shell: bash
run: ${SCCACHE_PATH} --show-stats
- name: Verify binary version
shell: bash
run: |
GIT_COMMIT=`git log -1 --format="%H" | cut -c1-7`
MB_VERSION=`./target/release/moonkit-template --version`
echo "Checking $MB_VERSION contains $GIT_COMMIT"
echo "$MB_VERSION" | grep $GIT_COMMIT
- name: Save runtimes wasm
shell: bash
run: |
mkdir -p runtimes
cp target/release/wbuild/moon*/moon*_runtime.compact.compressed.wasm runtimes/;
- name: Save moonkit-template binary
shell: bash
run: |
mkdir -p build
cp target/release/moonkit-template build/moonkit-template;
51 changes: 6 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,24 +259,8 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ needs.set-tags.outputs.git_ref }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install libclang
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
- name: Cargo build
uses: ./.github/workflow-templates/cargo-build
- name: Upload runtimes
uses: actions/upload-artifact@v4.6.0
with:
name: runtimes
path: runtimes
- name: Upload binary
uses: actions/upload-artifact@v4.6.0
with:
name: moonkit-template
path: build/moonkit-template

build-features:
runs-on:
Expand All @@ -287,30 +271,15 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ needs.set-tags.outputs.git_ref }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install libclang
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
- name: Cargo build
uses: ./.github/workflow-templates/cargo-build
with:
features: "try-runtime,runtime-benchmarks"
- name: Upload binary
uses: actions/upload-artifact@v4.6.0
with:
name: moonkit-template-features
path: build/moonkit-template

rust-test:
runs-on:
labels: ubuntu-latest
needs: ["set-tags"]
env:
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: "1GB"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -322,8 +291,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Rust Cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
- name: Setup Variables
shell: bash
run: |
Expand All @@ -332,18 +301,10 @@ jobs:
shell: bash
run: |
mkdir -p mold
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v1.1.1/mold-1.1.1-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
# With rustup's nice new toml format, we just need to run rustup show to install the toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.40.4/mold-2.40.4-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
- name: Setup Rust toolchain
run: |
if ! which "rustup" > /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
rustup show
# Checks are run after uploading artifacts since they are modified by the tests
run: rustup show
- name: Unit tests
run: |
cargo test --workspace --exclude moonkit-template-runtime
- name: Run sccache stat for check pre test
run: ${SCCACHE_PATH} --show-stats
curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
cargo nextest run --release --workspace
16 changes: 0 additions & 16 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ members = [
"primitives/*",
"template/node",
"template/runtime",
"template/pallets/template",
]
resolver = "2"

Expand Down
1 change: 0 additions & 1 deletion template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ A Polkadot SDK based project such as this one consists of:

* 💿 a [Node](./node/README.md) - the binary application.
* 🧮 the [Runtime](./runtime/README.md) - the core logic of the parachain.
* 🎨 the [Pallets](./pallets/README.md) - from which the runtime is constructed.

## Getting Started

Expand Down
13 changes: 0 additions & 13 deletions template/pallets/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions template/pallets/template/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion template/pallets/template/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions template/pallets/template/src/benchmarking.rs

This file was deleted.

103 changes: 0 additions & 103 deletions template/pallets/template/src/lib.rs

This file was deleted.

Loading