From 84e0712b57c7b94249fb76b7b5a33e4a03c20dfe Mon Sep 17 00:00:00 2001 From: hu55a1n1 Date: Thu, 11 Jan 2024 03:55:36 -0800 Subject: [PATCH] Add rust workflow --- .github/workflows/rust.yml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..9bae1a4 --- /dev/null +++ b/.github/workflows/rust.yml @@ -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