Add rust workflow
This commit is contained in:
parent
b304ddc059
commit
84e0712b57
1 changed files with 79 additions and 0 deletions
79
.github/workflows/rust.yml
vendored
Normal file
79
.github/workflows/rust.yml
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
name: Rust
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/rust.yml
|
||||
- .gitmodules
|
||||
- Cargo.lock
|
||||
- Cargo.toml
|
||||
- enclaves/**
|
||||
- utils/**
|
||||
push:
|
||||
branches: master
|
||||
paths:
|
||||
- .github/workflows/rust.yml
|
||||
- .gitmodules
|
||||
- Cargo.lock
|
||||
- Cargo.toml
|
||||
- enclaves/**
|
||||
- utils/**
|
||||
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_PROFILE_DEV_DEBUG: 1
|
||||
CARGO_PROFILE_RELEASE_DEBUG: 1
|
||||
RUST_BACKTRACE: short
|
||||
CARGO_NET_RETRY: 10
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
nightly-fmt:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
args: --all-features --all-targets
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features --no-fail-fast --no-run
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all-features --no-fail-fast --workspace -- --nocapture
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --no-default-features --no-fail-fast --no-run
|
Loading…
Reference in a new issue