-
Notifications
You must be signed in to change notification settings - Fork 5
155 lines (144 loc) · 4.67 KB
/
static-analysis.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Static Analysis
on:
pull_request:
branches:
- '!release-plz-*'
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- name: Dependencies
run: sudo apt-get update && sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev clang lld
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: CI job
run: "cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::type_complexity -W clippy::doc_markdown"
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-fmt-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: CI job
run: cargo fmt --all -- --check
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-docs-${{ hashFiles('**/Cargo.toml') }}
- name: Ensure docs compile
run: cargo doc --no-deps -p dexterous_developer
env:
RUSTDOCFLAGS: -Dwarnings
mdbook:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- run: mdbook build
check-markdown-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check dead links
continue-on-error: true
id: run1
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: Sleep for 30 seconds
if: steps.run1.outcome=='failure'
run: sleep 30s
shell: bash
- name: check dead links (retry)
continue-on-error: true
id: run2
if: steps.run1.outcome=='failure'
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: Sleep for 30 seconds
if: steps.run2.outcome=='failure'
run: sleep 30s
shell: bash
- name: check dead links (retry 2)
continue-on-error: true
id: run3
if: steps.run2.outcome=='failure'
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: set the status
if: always()
run: |
if ${{ steps.run1.outcome=='success' || steps.run2.outcome=='success' || steps.run3.outcome=='success' }}; then
echo success
else
exit 1
fi
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- run: |
rm ./CHANGELOG.md
rm ./docs/src/SUMMARY.md
- name: Run Markdown Lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: "(CHANGELOG.md | docs/src/SUMMARY.md)"