-
Notifications
You must be signed in to change notification settings - Fork 114
53 lines (42 loc) · 1.25 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: build
on: [push, pull_request]
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@v3
- uses: actions/cache@v3
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@v3
with:
name: ${{ runner.os }}
if-no-files-found: error
path: |
target/release/display_switch
target/release/display_switch.exe