From 143fc87287ebf4fe36f0d84b9a01079bfa984e17 Mon Sep 17 00:00:00 2001 From: Taehoon Moon Date: Tue, 27 Aug 2024 12:20:51 +0900 Subject: [PATCH] Setup rust.yml gh action - clippy, fmt and build --- .github/workflows/rust.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 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..3c2908a --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,41 @@ +name: Rust + +on: + push: + branches: [ "main" ] + paths-ignore: + - "docs/**" + pull_request: + branches: [ "main" ] + paths-ignore: + - "docs/**" + +env: + CARGO_TERM_COLOR: always + +jobs: + clippy_workspace: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --all-targets -- -D warnings + + rust_fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - run: | + cargo fmt -- --check + + rust_build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - run: cargo build --all-features --verbose +