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:
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