-
Notifications
You must be signed in to change notification settings - Fork 7
83 lines (76 loc) · 2.24 KB
/
rust.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
name: Build, test and doc
on:
# At the moment, this doesn’t work due to a bug with GitHub:
# <https://github.community/t/support-for-yaml-anchors/16128>
# Once that bug is fixed, this version should be used.
#push: &push_settings
#paths:
#- '**/Cargo.lock'
#- '**/Cargo.toml'
#- '**.rs'
#- '.github/workflows/rust.yml'
#pull_request: *push_settings
# In the meantime, we can just repeat ourselves.
push:
paths:
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**.rs'
- '.github/workflows/rust.yml'
pull_request:
paths:
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**.rs'
- '.github/workflows/rust.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [linux, windows, macos]
include:
- platform: linux
os: ubuntu-latest
- platform: windows
os: windows-latest
- platform: macos
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v2
id: cache-cargo
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-cargo-v1-${{ hashFiles('**/Cargo.lock') }}
- name: ⚙️ Install OS dependencies
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev libbluetooth-dev libudev-dev
- name: ⚙️ Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --workspace
- name: 🔨 Build Documentation
uses: actions-rs/cargo@v1
if: matrix.platform == 'linux'
with:
command: doc
args: --workspace --no-deps
- name: ☁️ Deploy Documentation
uses: peaceiris/actions-gh-pages@v3
if: matrix.platform == 'linux' && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc