Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 217 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,94 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Faster compilation with incremental disabled for CI
CARGO_INCREMENTAL: 0

jobs:
check:
name: Check ${{ matrix.os }}
# ============================================
# Format Check - Fast, runs first
# ============================================
format:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check

# ============================================
# Lint - Clippy analysis
# ============================================
lint:
name: Lint (Clippy)
runs-on: ubuntu-latest
needs: format
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libssl-dev \
libgtk-3-dev \
libglib2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libpango1.0-dev \
libgdk-pixbuf2.0-dev \
libwayland-dev \
libxcb1-dev \
libxcb-randr0-dev \
libxcb-xkb-dev \
libx11-xcb-dev

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-lint-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-lint-

- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
continue-on-error: true

# ============================================
# Test - Run on all platforms
# ============================================
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: format
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -48,27 +131,149 @@ jobs:
libxcb-xkb-dev \
libx11-xcb-dev

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-test-

- name: Run cargo check
run: cargo check --all-targets

- name: Run cargo test
run: cargo test
- name: Run tests
run: cargo test --all-features -- --nocapture

- name: Run cargo clippy
run: cargo clippy -- -D warnings
continue-on-error: true
# ============================================
# Build - Verify release builds work
# ============================================
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [lint, test]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

format:
name: Format check
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libssl-dev \
libgtk-3-dev \
libglib2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libpango1.0-dev \
libgdk-pixbuf2.0-dev \
libwayland-dev \
libxcb1-dev \
libxcb-randr0-dev \
libxcb-xkb-dev \
libx11-xcb-dev

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-release-

- name: Build release binary
run: cargo build --release

- name: Verify binary exists (Unix)
if: matrix.os != 'windows-latest'
run: |
ls -la target/release/ultralog
file target/release/ultralog

- name: Verify binary exists (Windows)
if: matrix.os == 'windows-latest'
run: |
dir target\release\ultralog.exe

# ============================================
# Documentation - Verify docs build
# ============================================
docs:
name: Documentation
runs-on: ubuntu-latest
needs: format
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libssl-dev \
libgtk-3-dev \
libglib2.0-dev \
libatk1.0-dev \
libcairo2-dev \
libpango1.0-dev \
libgdk-pixbuf2.0-dev \
libwayland-dev \
libxcb1-dev \
libxcb-randr0-dev \
libxcb-xkb-dev \
libx11-xcb-dev

- name: Cache Cargo registry
uses: actions/cache@v4
with:
components: rustfmt
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Check formatting
run: cargo fmt --all -- --check
- name: Build documentation
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
2 changes: 1 addition & 1 deletion src/parsers/haltech.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub enum ChannelType {

impl ChannelType {
/// Convert raw value to human-readable unit based on Haltech CAN protocol spec
/// Reference: https://support.haltech.com/portal/en/kb/articles/haltech-can-ecu-broadcast-protocol
/// Reference: <https://support.haltech.com/portal/en/kb/articles/haltech-can-ecu-broadcast-protocol>
pub fn convert_value(&self, raw: f64) -> f64 {
match self {
// RPM: y = x (no conversion)
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/romraider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! commonly used for Subaru ECUs. Format is comma-delimited CSV with
//! channel names and units in the header row.
//!
//! Reference: https://github.com/RomRaider/RomRaider
//! Reference: <https://github.com/RomRaider/RomRaider>

use serde::Serialize;
use std::error::Error;
Expand Down
Loading