Skip to content

General refactor: backend/frontend separation and API integration for ELF analysis #65

General refactor: backend/frontend separation and API integration for ELF analysis

General refactor: backend/frontend separation and API integration for ELF analysis #65

name: manifest-producer
on:
push:
branches:
- main
- new-code # to be removed
pull_request:
branches:
- main
- new-code # to be removed
env:
GRCOV_VERSION: "0.8.20"
jobs:
################################## FORMAT LAYER #########################################
clippy-rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy, rustfmt
- name: Run rustfmt
run: cargo fmt --all -- --check --verbose
- name: Run cargo clippy
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
################################## BACKEND LIGHT TESTS ##################################
backend-tests:
needs: [clippy-rustfmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install grcov
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_BINARY: grcov-x86_64-unknown-linux-musl.tar.bz2
run: |
curl -L "$GRCOV_LINK/v$GRCOV_VERSION/$GRCOV_BINARY" |
tar xj -C $HOME/.cargo/bin
- name: Run Backend Integration Tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "backend-%p-%m.profraw"
run: cargo test --test light_tests -- --nocapture
- name: Run Backend Unit Tests
env:
RUSTGLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "digest-%p-%m.profraw"
run: cargo test --lib --features "progress_bar" -- --nocapture
- name: Get coverage data for codecov
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
--ignore-not-existing --ignore "/*" --ignore "../*" \
--ignore "example/*" -o backend.info
- name: Upload Backend Coverage
uses: codecov/codecov-action@v4
with:
files: backend.info
token: ${{ secrets.CODECOV_TOKEN }}
################################## MULTI-PLATFORM TESTING JOB ###########################
multi-platform-build-test:
name: Build and Test on Multiple Platforms (Ubuntu, macOS, Windows)
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
needs: [backend-tests]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build the project
run: cargo build --workspace --all-features
- name: Generate docs
run: cargo doc --all-features --no-deps
- name: Run Docs Tests
run: cargo test --doc -- --nocapture