Skip to content

Enable LTO for release builds #117

Enable LTO for release builds

Enable LTO for release builds #117

Workflow file for this run

name: Build
# Runs for each commit/PR, but not tag push
on:
push:
branches:
- "**"
pull_request:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux Dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
#- name: cargo fmt
# run: cargo fmt --all -- --check
#- name: Run Clippy
# run: cargo clippy --all-targets --all-features
# TODO Remove this when releasing, I don't see a point in having this fail
# while I'm still in early days
- name: Allow warnings in builds (for now)
run: echo "RUSTFLAGS=" >> $GITHUB_ENV
- name: Build
run: cargo build --verbose
- name: Run Unit Tests
run: cargo test --all-targets --all-features
- name: Run Integration Tests
run: cargo test --all-targets --all-features -- --ignored --show-output --test-threads=1
cargo-hack:
name: cargo-hack
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux Dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Allow warnings in builds (for now)
run: echo "RUSTFLAGS=" >> $GITHUB_ENV
- run: cargo hack check --feature-powerset --no-dev-deps