|
28 | 28 | run: cargo test ${{ matrix.features }}
|
29 | 29 | - name: check formatting
|
30 | 30 | run: cargo fmt --all -- --check
|
31 |
| - - name: clippy |
32 |
| - run: cargo clippy ${{ matrix.features }} |
33 | 31 | - name: audit
|
34 | 32 | run: cargo audit
|
35 | 33 |
|
|
42 | 40 | with:
|
43 | 41 | targets: thumbv7em-none-eabihf
|
44 | 42 | components: rustfmt clippy
|
45 |
| - - name: Install flip-link |
46 |
| - run: cargo install flip-link |
| 43 | + - name: Install required cargo components |
| 44 | + run: cargo install clippy-sarif sarif-fmt flip-link |
47 | 45 | - name: build
|
48 | 46 | run: cargo build
|
49 | 47 | working-directory: examples/stm32f4-single-motor-example
|
|
54 | 52 | - name: check formatting
|
55 | 53 | run: cargo fmt --all -- --check
|
56 | 54 | working-directory: examples/stm32f4-single-motor-example
|
57 |
| - - name: clippy |
58 |
| - run: cargo clippy |
59 |
| - working-directory: examples/stm32f4-single-motor-example |
60 | 55 | - name: audit
|
61 | 56 | run: cargo audit
|
62 | 57 | working-directory: examples/stm32f4-single-motor-example
|
| 58 | + - name: clippy (example) |
| 59 | + # see the following comment for the patching workaround: https://github.com/psastras/sarif-rs/issues/370#issuecomment-1475364427 |
| 60 | + run: | |
| 61 | + cargo clippy --message-format=json | \ |
| 62 | + clippy-sarif | \ |
| 63 | + jq --arg pwd "examples/stm32f4-single-motor-example" '.runs[].results[].locations[].physicalLocation.artifactLocation.uri |= $pwd + "/" + .' | \ |
| 64 | + tee rust-clippy-results.sarif | \ |
| 65 | + sarif-fmt |
| 66 | + working-directory: examples/stm32f4-single-motor-example |
| 67 | + continue-on-error: true |
| 68 | + - name: Upload analysis results to GitHub |
| 69 | + uses: github/codeql-action/upload-sarif@v2 |
| 70 | + with: |
| 71 | + sarif_file: examples/stm32f4-single-motor-example/rust-clippy-results.sarif |
| 72 | + wait-for-processing: true |
| 73 | + |
| 74 | + clippy: |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v3 |
| 78 | + - name: install rust toolchain |
| 79 | + uses: dtolnay/rust-toolchain@stable |
| 80 | + with: |
| 81 | + components: rustfmt clippy |
| 82 | + - name: Install required cargo components |
| 83 | + run: cargo install clippy-sarif sarif-fmt |
| 84 | + - name: clippy (lib) |
| 85 | + run: cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt |
| 86 | + continue-on-error: true |
| 87 | + - name: Upload analysis results to GitHub |
| 88 | + uses: github/codeql-action/upload-sarif@v2 |
| 89 | + with: |
| 90 | + sarif_file: rust-clippy-results.sarif |
| 91 | + wait-for-processing: true |
0 commit comments