From 4a3b59217545c7140502c2bd7c5a036cc9f09967 Mon Sep 17 00:00:00 2001 From: Ilya Zlobintsev Date: Tue, 2 Mar 2021 08:36:07 +0200 Subject: [PATCH] Add github job for checking formatting --- .github/workflows/rust.yml | 39 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0ec5744..9beddac 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,27 +2,36 @@ name: Rust on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] env: CARGO_TERM_COLOR: always jobs: - build_test: - + build-test: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Update repos - run: sudo apt update - - name: Install dependencies - run: sudo apt install libgtk-3-dev libvulkan-dev - - name: Update pci.ids - run: sudo sh -c "curl https://pci-ids.ucw.cz/v2.2/pci.ids > /usr/share/misc/pci.ids" - - name: Build - run: cargo build - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v2 + - name: Update repos + run: sudo apt update + - name: Install dependencies + run: sudo apt install libgtk-3-dev libvulkan-dev + - name: Update pci.ids + run: sudo sh -c "curl https://pci-ids.ucw.cz/v2.2/pci.ids > /usr/share/misc/pci.ids" + - name: Build + run: cargo build + - name: Run tests + run: cargo test --verbose + + check-format: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - name: install rustfmt + run: rustup component add rustfmt + - name: Check formatting + run: cargo fmt -- --check