Add github job for checking formatting

This commit is contained in:
Ilya Zlobintsev 2021-03-02 08:36:07 +02:00
parent b2edcf60a8
commit 4a3b592175

View File

@ -2,27 +2,36 @@ name: Rust
on: on:
push: push:
branches: [ master ] branches: [master]
pull_request: pull_request:
branches: [ master ] branches: [master]
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
build_test: build-test:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Update repos - name: Update repos
run: sudo apt update run: sudo apt update
- name: Install dependencies - name: Install dependencies
run: sudo apt install libgtk-3-dev libvulkan-dev run: sudo apt install libgtk-3-dev libvulkan-dev
- name: Update pci.ids - name: Update pci.ids
run: sudo sh -c "curl https://pci-ids.ucw.cz/v2.2/pci.ids > /usr/share/misc/pci.ids" run: sudo sh -c "curl https://pci-ids.ucw.cz/v2.2/pci.ids > /usr/share/misc/pci.ids"
- name: Build - name: Build
run: cargo build run: cargo build
- name: Run tests - name: Run tests
run: cargo test --verbose 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