Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 committed Oct 20, 2022
1 parent f9d854b commit 23051c0
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 60 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ jobs:
name: Cover
runs-on: buildjet-8vcpu-ubuntu-2004
timeout-minutes: 30
steps:
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Install Dependencies
run: sudo make install-deps
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
timeout-minutes: 5
continue-on-error: true
cache-key: ${{ runner.os }}-sccache-codecov-${{ hashFiles('rust-toolchain.toml') }}
- name: Run cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
env:
CC: "/tmp/sccache/sccache clang"
CXX: "/tmp/sccache/sccache clang++"
- name: Upload CodeCov
uses: codecov/codecov-action@v3
with:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check-publish-docs:
name: Publish
runs-on: ubuntu-latest
steps:
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Apt Dependencies
Expand All @@ -27,13 +27,19 @@ jobs:
args: --verbose --no-progress 'README.md'
# Fail action on broken links
fail: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
timeout-minutes: 5
continue-on-error: true
cache-key: ${{ runner.os }}-sccache-${{ hashFiles('rust-toolchain.toml') }}
cache-save: false
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
key: ${{ runner.os }}-docs-cargo-bin-${{ hashFiles('rust-toolchain.toml') }}
- name: Install MDBook
run: cargo install mdbook mdbook-linkcheck
continue-on-error: true
- name: Execute MDBook
run: make mdbook-build
- name: Build rustdoc
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ jobs:
brew install --verbose coreutils
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
timeout-minutes: 5
continue-on-error: true
timeout-minutes: 5
continue-on-error: true
- name: Cargo Build
run: cargo build --release --bin forest --bin forest-cli
- name: Compress Binary
Expand Down
99 changes: 59 additions & 40 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ jobs:
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
cache-key: ${{ runner.os }}-sccache-test-${{ hashFiles('rust-toolchain.toml') }}
- name: Install Dependencies
run: sudo make install-deps
- name: install nextest
uses: taiki-e/install-action@nextest
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Cargo Check
run: cargo check
- name: Make Test-All
run: make test-all
- run: make test-all
env:
CC: "/tmp/sccache/sccache clang"
CXX: "/tmp/sccache/sccache clang++"

lint:
name: Lint
Expand All @@ -47,13 +46,19 @@ jobs:
uses: actions/checkout@v3
- name: Apt Dependencies
run: sudo make install-deps
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
cache-key: ${{ runner.os }}-sccache-${{ hashFiles('rust-toolchain.toml') }}
cache-save: false
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
key: ${{ runner.os }}-lint-cargo-bin-${{ hashFiles('rust-toolchain.toml') }}
- name: Install taplo (TOML linter)
run: cargo install taplo-cli --locked
continue-on-error: true
- name: Run Linters
run: make lint

Expand All @@ -65,9 +70,8 @@ jobs:
uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Install Audit
run: cargo install cargo-audit
- name: Run Audit
Expand All @@ -79,15 +83,24 @@ jobs:
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
cache-key: ${{ runner.os }}-sccache-${{ hashFiles('rust-toolchain.toml') }}
cache-save: false
- uses: actions/cache@v3
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
path: |
~/.cargo/bin/
key: ${{ runner.os }}-udeps-cargo-bin-${{ hashFiles('rust-toolchain.toml') }}
- name: Install udeps
run: cargo install cargo-udeps --locked
continue-on-error: true
- name: Run udeps
run: make udeps
env:
CC: "/tmp/sccache/sccache clang"
CXX: "/tmp/sccache/sccache clang++"

spellcheck:
name: Spellcheck
Expand All @@ -97,9 +110,8 @@ jobs:
uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Install spellcheck
run: cargo install cargo-spellcheck
- name: Run Spellcheck
Expand All @@ -110,36 +122,39 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- uses: visvirial/sccache-action@v1
- name: Setup sccache Linux
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
if: startsWith(matrix.os, 'Ubuntu')
with:
arch: x86_64-unknown-linux-musl
- uses: visvirial/sccache-action@v1
cache-key: ${{ runner.os }}-sccache-${{ hashFiles('rust-toolchain.toml') }}
- name: Setup sccache MACOS
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
if: startsWith(matrix.os, 'macOS')
with:
arch: x86_64-apple-darwin
cache-key: ${{ runner.os }}-sccache-${{ hashFiles('rust-toolchain.toml') }}
- name: Install Linux Dependencies
if: startsWith(matrix.os, 'Ubuntu')
run: |
lscpu # the job may run on different CPUs, list cpu here for analysing build time
sudo make install-deps
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
# Additional non workspace directories, separated by newlines
cache-directories: |
~/.cache/sccache/
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Cargo Build
run: cargo build --profile dev
- name: Cargo Check
run: cargo check --timings
env:
CC: "/tmp/sccache/sccache clang"
CXX: "/tmp/sccache/sccache clang++"
- uses: actions/upload-artifact@v3
with:
name: build-timings
path: |
target/cargo-timings/*
if-no-files-found: error

calibnet-check:
name: Calibnet sync check
Expand All @@ -152,13 +167,17 @@ jobs:
submodules: true
- name: Install Dependencies
run: sudo make install-deps
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup sccache
uses: hanabi1224/sccache-action@9a6eaffba482beb3b919ce68d12f2559b4db12b3
with:
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
# reuse build cache from test which also uses release profile
cache-key: ${{ runner.os }}-sccache-test-${{ hashFiles('rust-toolchain.toml') }}
cache-save: false
- name: build and install binaries
run: make install
env:
CC: "/tmp/sccache/sccache clang"
CXX: "/tmp/sccache/sccache clang++"
- name: download snapshot
run: forest-cli --chain calibnet chain fetch -s /tmp/snapshots/
- name: import snapshot and run Forest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ mdbook-build:
mdbook build ./documentation

rustdoc:
cargo doc --workspace --all-features --no-deps
cargo doc --workspace --no-deps

.PHONY: clean clean-all lint build release test test-all test-release license test-vectors run-vectors pull-serialization-tests install-cli install-daemon install install-deps docs run-serialization-vectors rustdoc
1 change: 0 additions & 1 deletion forest/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ tokio = { workspace = true, features = ["sync"] }
toml = "0.5"
uuid = { version = "1.1", features = ["v4"] }


[dependencies.jsonrpc-v2]
default-features = false
features = ["easy-errors", "macros", "bytes-v05"]
Expand Down
1 change: 0 additions & 1 deletion forest/daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ time.workspace = true
tokio = { workspace = true, features = ["sync"] }
toml = "0.5"


[dependencies.jsonrpc-v2]
default-features = false
features = ["easy-errors", "macros", "bytes-v05"]
Expand Down
1 change: 0 additions & 1 deletion forest/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ time.workspace = true
tokio = { workspace = true, features = ["sync"] }
toml = "0.5"


[dependencies.jsonrpc-v2]
default-features = false
features = ["easy-errors", "macros", "bytes-v05"]
Expand Down
7 changes: 4 additions & 3 deletions taplo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[formatting]
align_entries = true
column_width = 120
array_auto_expand = true
align_entries = true
column_width = 120
array_auto_expand = true
allowed_blank_lines = 1

[[rule]]
keys = ["dependencies", "dev-dependencies", "toolchain", "workspace.dependencies"]
Expand Down

0 comments on commit 23051c0

Please sign in to comment.