Skip to content

Update rust.yml, enable caching, disable some steps for now #9

Update rust.yml, enable caching, disable some steps for now

Update rust.yml, enable caching, disable some steps for now #9

Workflow file for this run

name: Rust CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: Install Dependencies
run: sudo apt install libdbus-1-dev pkg-config && rustup component add clippy rustfmt
- name: Run Clippy (Linting)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run Tests
run: cargo test --all-targets --all-features --verbose
- name: Build Project
run: cargo build --release
- name: Upload Build Artifacts
if: never()

Check failure on line 52 in .github/workflows/rust.yml

View workflow run for this annotation

GitHub Actions / Rust CI/CD

Invalid workflow file

The workflow is not valid. .github/workflows/rust.yml (Line: 52, Col: 13): Unrecognized function: 'never'. Located at position 1 within expression: never() .github/workflows/rust.yml (Line: 67, Col: 13): Unrecognized function: 'never'. Located at position 1 within expression: never()
uses: actions/upload-artifact@v3
with:
name: hrv-rs-build
path: target/release/
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run Coverage Analysis
run: cargo tarpaulin --out Xml --all-targets --all-features
env:
RUSTFLAGS: "-C link-dead-code" # Required for accurate coverage analysis
- name: Upload coverage reports to Codecov
if: never()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload to Codecov
if: never()
uses: codecov/codecov-action@v3
with:
files: tarpaulin-report.xml
fail_ci_if_error: true
flags: unittests