Skip to content

Add netlist.deep_clone() (#91) #264

Add netlist.deep_clone() (#91)

Add netlist.deep_clone() (#91) #264

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test --all-features
# Check formatting with rustfmt
formatting:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Ensure rustfmt is installed and setup problem matcher
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
# Check warnings from clippy
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets --all-features
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --json > coverage.json
- name: Coverage (60% by line)
run: python3 utils/code_coverage.py -p 60.0 coverage.json --whitelist src/util.rs src/logic.rs >> $GITHUB_STEP_SUMMARY
- name: Coverage (80% by line)
run: python3 utils/code_coverage.py -p 80.0 coverage.json --whitelist src/util.rs src/logic.rs >> $GITHUB_STEP_SUMMARY
- name: Coverage (87% by line)
run: python3 utils/code_coverage.py -p 87.0 coverage.json --whitelist src/util.rs src/logic.rs >> $GITHUB_STEP_SUMMARY
mdformat:
name: Markdown format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Markdown check format
uses: ydah/mdformat-action@main
with:
number: true
pyformat:
name: Python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format python code
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./utils"