Feat amend #281
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- main | |
paths-ignore: | |
- 'book/**' | |
- README.md | |
- README-CN.md | |
- LICENSE | |
- Dockerfile | |
- .gitignore | |
- .dockerignore | |
workflow_dispatch: | |
env: | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: 1 | |
PROTOC_NO_VENDOR: 1 | |
jobs: | |
rustfmt: | |
name: rustfmt | |
runs-on: [self-hosted, Linux, alibaba-cloud] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
components: rustfmt | |
- name: Check formating | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: clippy | |
runs-on: [self-hosted, Linux, alibaba-cloud] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
components: clippy | |
- name: Use cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Check clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets | |
test: | |
name: test | |
runs-on: [self-hosted, Linux, alibaba-cloud] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Use cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all-targets | |
build: | |
name: build | |
runs-on: [self-hosted, Linux, alibaba-cloud] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Use cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Run build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --all-targets |