80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
|
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
|