framework-tool-tui 0.8.4

TUI for controlling and monitoring Framework Computers hardware built in Rust
Documentation
name: Build

on:
  push:
    branches: [ "main" ]
  pull_request:

env:
  GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
  CARGO_TERM_COLOR: always

jobs: 
  lint:
    name: Lint
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false

    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install libudev-dev
        run: sudo apt-get update && sudo apt-get install -y libudev-dev
        
      - uses: moonrepo/setup-rust@v1
        with:
          bins: cargo-make
          components: rustfmt,clippy

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

      - name: Run Clippy
        run: cargo make lint

      - name: Run tests
        run: cargo make test

  build:
    name: Build
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        include:
          - build: linux
            os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - build: freebsd
            os: ubuntu-latest
            target: x86_64-unknown-freebsd
          - build: windows
            os: windows-2025
            target: x86_64-pc-windows-msvc
            # TODO: Remove rustflags workaround when framework_lib updates to built v0.8+ with gix feature.
            # Issue: libgit2-sys v0.14.x doesn't link advapi32.lib on Windows.
            # See: https://github.com/rust-lang/git2-rs/issues/1016
            rustflags: "-C link-arg=advapi32.lib"
          
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install libudev-dev (Linux)
        if: matrix.build == 'linux'
        run: sudo apt-get update && sudo apt-get install -y libudev-dev

      - name: Build FreeBSD
        if: matrix.build == 'freebsd'
        uses: vmactions/freebsd-vm@v1
        with:
          release: "15.0"
          arch: x86_64
          mem: 8192
          sync: rsync
          prepare: |
            pkg install -y rust hidapi pkgconf
          run: |
            cargo build --release --locked

      - uses: moonrepo/setup-rust@v1
        if: matrix.build != 'freebsd'
        with:
          targets: ${{ matrix.target }}

      - name: Build
        if: matrix.build != 'freebsd'
        run: cargo build --release --locked
        env:
          RUSTFLAGS: ${{ matrix.rustflags }}