From ec9541f38e74801e2b06cd0ffbd0882bf7405d55 Mon Sep 17 00:00:00 2001 From: kozabrada123 <59031733+kozabrada123@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:53:43 +0200 Subject: [PATCH] CI/CD: add cargo-doc job (#544) * CI/CD: add cargo-doc job * fix: make it rustdoc, totally not clippy --- .github/workflows/cargo-doc.yml | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/cargo-doc.yml diff --git a/.github/workflows/cargo-doc.yml b/.github/workflows/cargo-doc.yml new file mode 100644 index 0000000..017dbe2 --- /dev/null +++ b/.github/workflows/cargo-doc.yml @@ -0,0 +1,35 @@ +name: cargo doc lints + +on: + push: + branches: [ "main", "preserve/*" ] + pull_request: + branches: [ "main", "dev" ] + +jobs: + cargo-doc-lints: + name: Run cargo doc for doc lints + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install aditional components for sarif + run: cargo install clippy-sarif sarif-fmt + + - name: Run cargo doc + run: cargo doc --no-deps --all-features --locked --message-format=json | clippy-sarif | sed 's/rust-lang.github.io\/rust-clippy/doc.rust-lang.org\/rustdoc\/lints.html/g' | sed 's/clippy/rustdoc/g' | tee cargo-doc-results.sarif | sarif-fmt + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: cargo-doc-results.sarif + wait-for-processing: true