-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (33 loc) · 1.25 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
name: Rust
on:
push:
branches: [ root ]
pull_request:
branches: [ root ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
# - name: Install buf
# run: curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" -o "/usr/local/buf" && chmod +x "/usr/local/buf"
- name: Check
run: cargo check
- name: Format
run: cargo fmt --all
- name: Clippy
run: cargo clippy -- -D warnings
- name: Build docs
run: cargo rustdoc --lib -- --enable-index-page -Z unstable-options
- name: Setup git
run: git config --global user.name ${GITHUB_ACTOR} && git config --global user.email ${GITHUB_ACTOR}@users.noreply.github.com
- name: Push docs
run: rm -rf docs && mv target/doc docs && cp -a swagger docs && cp gen/openapiv2/epp.swagger.json docs/swagger && git add docs && (git diff-index --quiet HEAD docs || git commit -m "Autogen docs") && git push
- name: Push other
run: git add . && (git diff-index --quiet HEAD || git commit -m "rustfmt") && git push