From 02f15aac82fe3a1a2537004f385968bce8317d11 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 Mar 2021 17:32:36 +0000 Subject: [PATCH] ci: Add a Github Action for Rust lints I'd like to move `cargo fmt` checking out of Jenkins; among other things, GH actions are *much* faster and nicer for this. This leaves Jenkins to be more heavyweight testing. --- .github/workflows/rust-lints.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/rust-lints.yml diff --git a/.github/workflows/rust-lints.yml b/.github/workflows/rust-lints.yml new file mode 100644 index 00000000..896beb2a --- /dev/null +++ b/.github/workflows/rust-lints.yml @@ -0,0 +1,27 @@ +--- +name: Rust +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + CARGO_TERM_COLOR: always + ACTIONS_LINTS_TOOLCHAIN: 1.50.0 + +jobs: + linting: + name: "cargo fmt" + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }} + default: true + components: rustfmt + - name: cargo fmt (check) + run: cargo fmt -- --check -l