From 9e097f3950606746a007353f3ec871a46776f065 Mon Sep 17 00:00:00 2001 From: will <64425242+willser@users.noreply.github.com> Date: Sun, 24 Apr 2022 21:10:52 +0800 Subject: [PATCH] Create rust.yml --- .github/workflows/rust.yml | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 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..7fca858 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,51 @@ +on: [push, pull_request] + +name: CI + +jobs: + check_default: + name: cargo check (default features) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - run: sudo apt-get update && sudo apt-get install libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev pkg-config libfreetype6-dev libfontconfig1-dev + - uses: actions-rs/cargo@v1 + with: + command: check + fmt: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: cargo clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - run: rustup component add clippy + - run: sudo apt-get update && sudo apt-get install libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev pkg-config libfreetype6-dev libfontconfig1-dev + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings -W clippy::all