forked from inkdevhub/drink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from r0gue-io/chungquantin/refactor-formatting
fix: format with pop-node config
- Loading branch information
Showing
43 changed files
with
2,067 additions
and
1,984 deletions.
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,32 @@ | ||
name: Initialize | ||
description: This action initializes a runner for use in other actions. | ||
inputs: | ||
cache-key: | ||
description: "The key to be used for the cache" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Ubuntu dependencies | ||
shell: bash | ||
run: sudo apt update && sudo apt install -y protobuf-compiler | ||
|
||
- name: Free up space on runner | ||
shell: bash | ||
run: | | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
sudo rm -rf /usr/local/.ghcup | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /usr/local/share/boost | ||
sudo rm -rf /usr/local/share/powershell | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/share/swift | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
with: | ||
cache-on-failure: true | ||
cache-all-crates: true | ||
key: ${{ inputs.cache-key }} |
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,75 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: "./.github/actions/init" | ||
|
||
- name: Check formatting | ||
run: | | ||
rustup toolchain install nightly --profile minimal --component rustfmt | ||
cargo +nightly fmt --all -- --check | ||
- name: Check manifests | ||
run: | | ||
cargo install taplo-cli --locked | ||
taplo format --check | ||
- name: Check features | ||
run: | | ||
cargo install zepter --locked | ||
zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --feature-enables-dep="try-runtime:frame-try-runtime" --locked | ||
zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --feature-enables-dep="runtime-benchmarks:frame-benchmarking" --locked | ||
zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --locked | ||
zepter format features | ||
check: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: "./.github/actions/init" | ||
|
||
- name: Check Build | ||
run: | | ||
cargo check --release --locked --features=runtime-benchmarks,try-runtime | ||
clippy: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
env: | ||
RUSTFLAGS: "-Wmissing_docs" | ||
SKIP_WASM_BUILD: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: "./.github/actions/init" | ||
|
||
- name: Annotate with Clippy warnings | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --release --locked --features=runtime-benchmarks | ||
|
||
test: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: "./.github/actions/init" | ||
|
||
- name: Run tests | ||
run: cargo test --release --locked --workspace --features=runtime-benchmarks --exclude integration-tests |
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,20 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
lint: | ||
name: Validate PR title for conventional commit compliance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,24 @@ | ||
# Non-default formatting configuration options: use with `cargo +nightly fmt --all` | ||
binop_separator = "Back" | ||
chain_width = 80 | ||
combine_control_expr = false | ||
comment_width = 100 | ||
condense_wildcard_suffixes = true | ||
edition = "2021" | ||
format_code_in_doc_comments = true | ||
format_strings = true | ||
group_imports = "StdExternalCrate" | ||
hard_tabs = true | ||
imports_granularity = "Crate" | ||
match_arm_blocks = false | ||
match_block_trailing_comma = true | ||
newline_style = "Unix" | ||
normalize_comments = true | ||
reorder_impl_items = true | ||
trailing_semicolon = false | ||
unstable_features = true | ||
use_field_init_shorthand = true | ||
# Uses max_width or its default value (100) if not specified. | ||
use_small_heuristics = "Max" | ||
use_try_shorthand = true | ||
wrap_comments = 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,17 @@ | ||
# all options https://taplo.tamasfe.dev/configuration/formatter-options.html | ||
|
||
exclude = [ "networks/**", "target/**" ] | ||
|
||
# global rules | ||
[formatting] | ||
array_auto_collapse = false | ||
array_auto_expand = true | ||
compact_arrays = false # zepter compatibility | ||
indent_string = " " # tab | ||
inline_table_expand = false | ||
reorder_arrays = true | ||
reorder_keys = true | ||
|
||
[[rule]] | ||
include = [ "Cargo.toml" ] | ||
keys = [ "workspace.dependencies" ] |
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
Oops, something went wrong.