CodeQL / Clippy #150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodeQL / Clippy | |
| on: | |
| workflow_call: | |
| inputs: | |
| ref: | |
| description: git branch, tag or SHA to checkout. | |
| type: string | |
| required: true | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| default: "" | |
| description: git branch, tag or SHA to checkout. | |
| type: string | |
| required: false | |
| schedule: | |
| - cron: "0 15 * * 1,3,5" | |
| push: | |
| branches: [main, master] | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| CARGO_TERM_COLOR: always | |
| CARGO_TERM_PROGRESS_WHEN: never | |
| jobs: | |
| tools: | |
| name: Tools | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - name: Install Clippy | |
| run: rustup component add clippy | |
| - name: Config | |
| uses: ./.github/actions/init-cfg | |
| - name: Install Deps | |
| uses: ./.github/actions/tools-deps | |
| - name: Install cargo-binstall | |
| uses: cargo-bins/cargo-binstall@main | |
| - name: Install cargo-deduplicate-warnings | |
| run: cargo binstall cargo-deduplicate-warnings | |
| - name: Install sarif | |
| run: cargo binstall clippy-sarif sarif-fmt | |
| - name: Clippy -> Sarif | |
| # continue-on-error: true | |
| run: >- | |
| cargo clippy | |
| -p=cargo-playdate | |
| -p=playdate-bindgen | |
| -p=playdate-bindgen-cfg | |
| -p=playdate-build | |
| -p=playdate-device | |
| -p=playdate-simulator-utils | |
| -p=playdate-build-utils | |
| -p=playdate-tool | |
| --bins --examples --all-targets --no-deps | |
| --message-format=json | cargo deduplicate-warnings | clippy-sarif | tee results.sarif | sarif-fmt | |
| - name: Fix PWD | |
| if: runner.os == 'Windows' | |
| run: >- | |
| cat results.sarif | |
| | jq --arg pwd "some_folder/my_crate" '.runs[].results[].locations[].physicalLocation.artifactLocation.uri |= $pwd + "/" + .' | |
| > results.sarif | |
| - name: Upload CodeQl | |
| id: upload | |
| continue-on-error: true | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sha: ${{ steps.checkout.outputs.commit }} | |
| ref: ${{ steps.checkout.outputs.ref || inputs.ref || github.ref }} | |
| sarif_file: results.sarif | |
| wait-for-processing: true | |
| category: Clippy | |
| - name: Results | |
| run: >- | |
| echo "sarif id: ${{ steps.upload.outputs.sarif-id }}" |