-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Skeleton * XCM configs * Bump toolchain * Code cleaning part.1 * Code cleaning part.2 * Update SS58 * Rename * Update token decimals * Format * Extract darwinia core primitives * License * Benchmarks * Extract constants * Docs * CI part.1 * Adjust the runtime pallets structure (#29) * frame-system * pallet-timestamp * pallet-authorship * pallet-balances * pallet-transaction-payment * pallet-parachain-system * pallet-parachain-info * pallet-aura-ext * pallet-xcmp-queue * pallet-dmp-queue * pallet-session * pallet-aura * pallet-collator-selection * format * deal ambiguous name * fix compile * clear imports * update visibility for pallets * add license for pallets * update darwinia comments * CI part.2 Signed-off-by: Xavier Lau <xavier@inv.cafe> * CI part.3 * CI part.4 * Add missing features * Case * Setup build environment * CI part.5 * Enable `kusama-native`, `rococo-native` Signed-off-by: Xavier Lau <xavier@inv.cafe> Co-authored-by: Guantong <04637@163.com>
- Loading branch information
1 parent
5c3606a
commit 11780e3
Showing
47 changed files
with
16,404 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
cargo clean --release -p darwinia 2> /dev/null || true | ||
cargo clean --release -p darwinia-runtime 2> /dev/null || true | ||
rm -rf target/release/wbuild 2> /dev/null || true | ||
|
||
cargo clean -p darwinia 2> /dev/null || true | ||
cargo clean -p darwinia-runtime 2> /dev/null || true | ||
rm -rf target/debug/wbuild 2> /dev/null || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Auto author assign" | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
assign-author: | ||
name: Author assign | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: toshimaru/auto-author-assign@v1.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
name: Checks | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- "**.toml" | ||
- "**lock" | ||
- "**.json" | ||
- "**.yml" | ||
pull_request: | ||
types: [opened, synchronize, ready_for_review] | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- "**.toml" | ||
- "**lock" | ||
- "**.json" | ||
- "**.yml" | ||
|
||
env: | ||
GITHUB_CACHE_VERSION: 0 | ||
|
||
RUST_TOOLCHAIN: nightly | ||
RUST_BACKTRACE: full | ||
RUSTC_WRAPPER: sccache | ||
|
||
SCCACHE_LINK: https://github.com/mozilla/sccache/releases/download | ||
SCCACHE_VERSION: v0.3.0 | ||
SCCACHE_DIR: /home/runner/.cache/sccache | ||
|
||
SUBALFRED_LINK: https://github.com/hack-ink/subalfred/releases/latest/download/subalfred-x86_64-unknown-linux-gnu.zst | ||
|
||
jobs: | ||
basic-checks: | ||
name: Task ${{ matrix.action }} darwinia | ||
if: github.event_name == 'push' || !github.event.pull_request.draft | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
action: [build, test] | ||
|
||
steps: | ||
- name: Setup build environment | ||
run: sudo apt install -y protobuf-compiler | ||
- name: Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
default: true | ||
- name: Install Sccache | ||
run: | | ||
export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl | ||
curl -L ${{ env.SCCACHE_LINK }}/${{ env.SCCACHE_VERSION }}/$SCCACHE_FILE.tar.gz | tar xz | ||
sudo mv $SCCACHE_FILE/sccache /usr/bin | ||
sudo chmod u+x /usr/bin/sccache | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
- name: Cache cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: cargo-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: cargo-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}- | ||
- name: Cache sccache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.SCCACHE_DIR}} | ||
key: sccache-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: sccache-${{ matrix.action }}-${{ env.GITHUB_CACHE_VERSION }}- | ||
- name: Action ${{ matrix.action }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ${{ matrix.action }} | ||
args: --release --locked --features all-native | ||
- name: Compress | ||
if: matrix.action != 'test' | ||
run: | | ||
mv target/release/darwinia . | ||
tar cf darwinia.tar.zst darwinia -I pzstd | ||
- name: Upload | ||
if: matrix.action != 'test' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: darwinia | ||
path: darwinia.tar.zst | ||
- name: Shrink cache | ||
run: .github/shrink-cache.sh | ||
|
||
features-checks: | ||
name: Task check features | ||
if: github.event_name == 'push' || !github.event.pull_request.draft | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
default: true | ||
- name: Install Subalfred | ||
run: | | ||
curl -L ${{ env.SUBALFRED_LINK }} | zstd -o subalfred -d | ||
chmod u+x subalfred | ||
sudo mv subalfred /usr/bin | ||
sudo chmod u+x /usr/bin/subalfred | ||
- name: Fetch latest code | ||
uses: actions/checkout@v3 | ||
- name: Check | ||
run: | | ||
unset RUSTC_WRAPPER | ||
subalfred check features runtime | ||
runtime-checks: | ||
name: Task check runtime | ||
if: github.event_name == 'push' || !github.event.pull_request.draft | ||
needs: [basic-checks] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Subalfred | ||
run: | | ||
curl -L ${{ env.SUBALFRED_LINK }} | zstd -o subalfred -d | ||
chmod u+x subalfred | ||
sudo mv subalfred /usr/bin | ||
sudo chmod u+x /usr/bin/subalfred | ||
- name: Download darwinia | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: darwinia | ||
- name: Install darwinia | ||
run: | | ||
tar xf darwinia.tar.zst -I pzstd | ||
sudo mv darwinia /usr/bin | ||
- id: check-darwinia-runtime-version | ||
name: Check Darwinia runtime version | ||
run: | | ||
OUTPUT=$(subalfred check runtime --executable darwinia --chain local --live https://rpc.polkadot.io --property version) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=check-darwinia-runtime-version::$OUTPUT" | ||
- id: check-darwinia-runtime-storage | ||
name: Check Darwinia runtime storage | ||
run: | | ||
OUTPUT=$(subalfred check runtime --executable darwinia --chain local --live https://rpc.polkadot.io --property storage) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=check-darwinia-runtime-storage::$OUTPUT" | ||
- if: github.ref != 'refs/heads/master' | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
append: true | ||
message: | | ||
<details> | ||
<summary>Commit ${{ github.event.pull_request.head.sha }}</summary> | ||
**Darwinia** | ||
> Check Runtime Version | ||
```diff | ||
${{ steps.check-darwinia-runtime-version.outputs.check-darwinia-runtime-version }} | ||
``` | ||
> Check Storage Prefix | ||
```diff | ||
${{ steps.check-darwinia-runtime-storage.outputs.check-darwinia-runtime-storage }} | ||
``` | ||
</details> | ||
checks-cleaning: | ||
name: Task checks cleaning | ||
if: always() | ||
needs: [features-checks, runtime-checks] | ||
steps: | ||
- name: Clean artifacts | ||
uses: geekyeggo/delete-artifact@v1 | ||
with: | ||
name: darwinia | ||
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This file is part of Darwinia. | ||
// | ||
// Copyright (C) 2018-2022 Darwinia Network | ||
// SPDX-License-Identifier: GPL-3.0 | ||
// | ||
// Darwinia is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Darwinia is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>. |
Oops, something went wrong.