Skip to content

Tiny refactor for USB device IDs #215

Tiny refactor for USB device IDs

Tiny refactor for USB device IDs #215

Workflow file for this run

name: build
on:
push:
branches:
- main
tags:
- '**'
pull_request:
types: [opened, synchronize, reopened]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
build:
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install build dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libudev-dev
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release
- name: Run tests
run: cargo test
- name: Run executable
run: ./target/release/display_switch --version
- uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
if-no-files-found: error
path: |
target/release/display_switch
target/release/display_switch.exe