Skip to content

CI/build improvements #204

CI/build improvements

CI/build improvements #204

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:
job:
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { os: macos-latest, target: universal2-apple-darwin }
- { os: windows-latest, target: x86_64-pc-windows-msvc }
runs-on: ${{ matrix.job.os }}
steps:
- name: Install build dependencies (Linux)
if: matrix.job.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libudev-dev
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build
run: make build-release
- name: Run tests
run: make 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