-
-
Notifications
You must be signed in to change notification settings - Fork 155
99 lines (93 loc) · 2.74 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Rust
on:
push:
branches: [dev, master]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
grcov-version: 0.8.0
jobs:
build:
strategy:
matrix:
os:
- macOS-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev
- name: Check
run: cargo check --all --bins --examples
- name: Check without default features
run: cargo check --all --bins --examples --no-default-features
- name: Check with all features
run: cargo check --all --bins --examples --all-features
- name: Run tests
run: cargo test --all
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: clippy ${{ matrix.os }}
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Format Rust code
run: cargo fmt --all -- --check
# coverage:
# strategy:
# matrix:
# os:
# - macOS-latest
# - ubuntu-latest
# - windows-latest
# runs-on: ${{ matrix.os }}
#
# env:
# RUSTC_BOOTSTRAP: 1
# steps:
# - uses: actions/checkout@v2
# - name: Install dependencies
# if: ${{ runner.os == 'Linux' }}
# run: sudo apt-get install libdbus-1-dev
# - name: Cache grcov
# uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/bin/grcov
# ~/.cargo/bin/grcov.exe
# ~/.cargo/.crates.toml
# ~/.cargo/.crates2.json
# key: ${{ runner.os }}-cargo-bin-${{ env.grcov-version }}
# - name: Install grcov
# uses: actions-rs/[email protected]
# with:
# crate: grcov
# version: ${{ env.grcov-version }}
# - name: Install llvm-tools
# run: rustup component add llvm-tools-preview
# - name: Build for coverage
# run: cargo build --all-features
# env:
# RUSTFLAGS: "-Zinstrument-coverage -Ccodegen-units=1"
# - name: Run tests with coverage
# run: cargo test --all-features
# env:
# RUSTFLAGS: "-Zinstrument-coverage"
# LLVM_PROFILE_FILE: "test-coverage-%p-%m.profraw"
# - name: Convert coverage
# run: grcov . -s . --binary-path target/debug/ -t lcov --branch --ignore-not-existing -o target/debug/lcov.info
# - name: Upload coverage to codecov.io
# uses: codecov/codecov-action@v1
# with:
# directory: ./target/debug
# fail_ci_if_error: true