This repository was archived by the owner on Dec 21, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
124 lines (116 loc) · 3.33 KB
/
rust.yml
File metadata and controls
124 lines (116 loc) · 3.33 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Rust
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- name: Update package index
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install libsystemd-dev pkg-config
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1.3.0
- uses: actions-rs/cargo@v1.0.3
with:
command: test
- uses: actions-rs/cargo@v1.0.3
with:
command: clean
rustfmt:
name: Run rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- name: Update package index
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install libsystemd-dev pkg-config
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- uses: actions-rs/cargo@v1.0.3
with:
command: fmt
args: --all -- --check
doc:
name: Run rustdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- name: Update package index
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install libsystemd-dev pkg-config
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- uses: Swatinem/rust-cache@v1.3.0
- uses: actions-rs/cargo@v1.0.3
with:
command: doc
args: --document-private-items
clippy:
name: Run clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- name: Update package index
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install libsystemd-dev pkg-config
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
components: clippy
override: true
# We need this due to: https://github.com/actions-rs/clippy-check/issues/2
- name: Check workflow permissions
id: check_permissions
uses: scherermichael-oss/action-has-permission@1.0.6
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1
if: steps.check_permissions.outputs.has-permission
with:
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy manually without annotations
if: ${{ !steps.check_permissions.outputs.has-permission }}
run: cargo clippy --all-targets -- -D warnings
cargo-deny:
name: Run cargo deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans
- licenses
- sources
steps:
- uses: actions/checkout@v2.3.5
- uses: EmbarkStudios/cargo-deny-action@v1.2.6
with:
command: check ${{ matrix.checks }}