-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (87 loc) · 2.83 KB
/
ci.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright 2023 runtime-shady-backroom
# This file is part of buttplug-lite.
# buttplug-lite is licensed under the AGPL-3.0 license (see LICENSE file for details).
name: CI
on:
pull_request:
branches:
- master # run for pull requests that target master
paths-ignore: # ignore files that can't alter build output
- '**.md'
- .github/dependabot.yml
- .github/workflows/build.yml
- .gitignore
- LICENSE
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
test:
strategy:
matrix:
target:
- runs-on: windows-latest
triple: x86_64-pc-windows-msvc
build-name: Windows
artifact-suffix: ''
suffix: .exe
path-separator: '\'
runner-can-execute: true
- runs-on: ubuntu-latest
triple: x86_64-unknown-linux-gnu
build-name: Linux
artifact-suffix: -linux
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: x86_64-apple-darwin
build-name: macOS x86
artifact-suffix: -mac-x86
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: aarch64-apple-darwin
build-name: macOS ARM
artifact-suffix: -mac-arm
suffix: ''
path-separator: '/'
runner-can-execute: false
fail-fast: false
name: Test ${{ matrix.target.build-name }}
runs-on: ${{ matrix.target.runs-on }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Setup workflow cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target.triple }}
- name: Install extra Linux dependencies
if: matrix.target.runs-on == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libudev-dev # libdbus-sys needs {ibdbus-1-dev, pkg-config}. libudev-sys needs {libudev-dev}
- name: Check
run: cargo check --target ${{ matrix.target.triple }}
- name: Test
if: matrix.target.runner-can-execute
run: cargo test --target ${{ matrix.target.triple }}
- name: Self-check
if: matrix.target.runner-can-execute
run: cargo run -- --self-check