prototyper.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # This workflow uses actions that are not certified by GitHub.
  2. # They are provided by a third-party and are governed by
  3. # separate terms of service, privacy policy, and support
  4. # documentation.
  5. # rust-clippy is a tool that runs a bunch of lints to catch common
  6. # mistakes in your Rust code and help improve your Rust code.
  7. # More details at https://github.com/rust-lang/rust-clippy
  8. # and https://rust-lang.github.io/rust-clippy/
  9. name: Prototyper
  10. on:
  11. pull_request:
  12. push:
  13. paths-ignore:
  14. - '**.md'
  15. - 'LICENSE'
  16. jobs:
  17. rust-clippy-analyze:
  18. name: Run rust-clippy analyzing
  19. runs-on: ubuntu-latest
  20. permissions:
  21. security-events: write
  22. steps:
  23. - name: Checkout code
  24. uses: actions/checkout@v4
  25. - name: Check format
  26. run: cargo fmt --check
  27. - name: Run test
  28. run: |
  29. cargo test -p rustsbi-prototyper
  30. - name: Install required cargo
  31. run: cargo install clippy-sarif sarif-fmt cargo-binutils
  32. - name: Install required target
  33. run: rustup target add riscv64imac-unknown-none-elf
  34. # Build the prototyper is needed before running cargo clippy for it, as the build is dependent on some logic controlled by xtask.
  35. - name: Build cargo prototyper
  36. run: cargo prototyper
  37. - name: Run rust-clippy
  38. run: |
  39. cargo clippy -p rustsbi-prototyper --target riscv64imac-unknown-none-elf --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
  40. cargo clippy -p rustsbi-test-kernel --target riscv64imac-unknown-none-elf --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
  41. cargo clippy -p rustsbi-bench-kernel --target riscv64imac-unknown-none-elf --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
  42. continue-on-error: true
  43. - name: Upload analysis results to GitHub
  44. uses: github/codeql-action/upload-sarif@v3
  45. with:
  46. sarif_file: rust-clippy-results.sarif
  47. wait-for-processing: true