LC in browser #2753
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
name: Avail Light CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
formatting: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt | |
- name: Check Rust formatting | |
uses: actions-rust-lang/rustfmt@v1 | |
- name: Check TOML, JSON, and MarkDown formatting | |
uses: dprint/check@v2.1 | |
clippy: | |
name: cargo clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: clippy | |
# TODO: Enable avail-light-web once issue with rocksdb feature being applied | |
# accross the workspace is resolved | |
- run: cargo clippy --workspace --exclude avail-light-web -- -D warnings | |
test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arduino/setup-protoc@v2 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
# TODO: Enable avail-light-web once issue with rocksdb feature being applied | |
# accross the workspace is resolved | |
- run: cargo test --workspace --benches --tests --exclude avail-light-web | |
env: | |
RUSTFLAGS: "-C instrument-coverage" | |
LLVM_PROFILE_FILE: "profile-%p-%m.profraw" | |
- name: Install grcov | |
run: cargo +stable install --force grcov | |
- name: Generate test code coverage report | |
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o lcov.info | |
- name: Upload test code coverage report to codecov.io | |
uses: codecov/codecov-action@v2 | |
with: | |
files: lcov.info | |
- name: Cleanup | |
run: find . -name \*.profraw -type f -exec rm -f {} + | |
wasm: | |
name: wasm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: wasm32-unknown-unknown | |
- run: cargo build --package avail-light-core --target wasm32-unknown-unknown | |