Run clippy in workflow

Signed-off-by: Walker Crouse <Walker.Crouse@bjss.com>
This commit is contained in:
Walker Crouse 2021-08-20 15:20:31 -04:00
parent 717c910c57
commit 79e3287db6
4 changed files with 26 additions and 5 deletions

View File

@ -14,10 +14,14 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Check formatting - name: Prepare
run: ./scripts/checkfmt.sh run: rustup component add clippy
- name: Build - name: Build
run: ./scripts/buildall.sh run: ./scripts/buildall.sh
- name: Check formatting
run: ./scripts/checkfmt.sh
- name: Run clippy
run: ./scripts/lintall.sh
- name: Run tests - name: Run tests
run: cargo test --verbose run: cargo test --verbose
@ -26,10 +30,12 @@ jobs:
steps: steps:
- 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: "rustup component add clippy && 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: ./scripts/buildall.sh run: ./scripts/buildall.sh
- name: Check formatting
run: ./scripts/checkfmt.sh
- name: Run clippy
run: ./scripts/lintall.sh
- name: Run tests - name: Run tests
run: cargo test --verbose run: cargo test --verbose

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
cargo build --workspace --verbose cargo build --workspace --verbose
( (
cd examples cd examples

View File

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

11
scripts/lintall.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
cargo clippy -- -D warnings
cargo clippy --all-targets --all-features -- -D warnings
(
cd examples
cargo clippy -- -D warnings
cargo clippy --all-targets --all-features -- -D warnings
)