Add github step to check formatting

Signed-off-by: Walker Crouse <Walker.Crouse@bjss.com>
This commit is contained in:
Walker Crouse 2021-08-20 14:58:13 -04:00
parent 4bd53f33be
commit c0dbc9f22d
2 changed files with 21 additions and 14 deletions

View File

@ -14,6 +14,8 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Check formatting
run: ./scripts/checkfmt.sh
- name: Build - name: Build
run: cargo build --verbose run: cargo build --verbose
- name: Run tests - name: Run tests
@ -25,6 +27,8 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Prepare - name: Prepare
run: "sudo apt -y install avahi-daemon libavahi-client-dev && sudo systemctl start avahi-daemon.service" run: "sudo apt -y install avahi-daemon libavahi-client-dev && sudo systemctl start avahi-daemon.service"
- name: Check formatting
run: ./scripts/checkfmt.sh
- name: Build - name: Build
run: cargo build --verbose run: cargo build --verbose
- name: Run tests - name: Run tests

3
scripts/checkfmt.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
find examples/browser/src examples/service/src zeroconf/src zeroconf-macros/src -type f -name *.rs -print0 | xargs -0 -n1 rustfmt --check --verbose