Pin GitHub Actions to full-length commit SHAs #1
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 Advanced" | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'gh-readonly-queue/**' | |
| pull_request: | |
| merge_group: | |
| schedule: # Trigger a job on default branch at 4AM PST everyday | |
| - cron: 0 11 * * * | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: windows-2025 | |
| permissions: | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| wdk: | |
| - version: 10.0.22621 # NI WDK | |
| source: winget | |
| - version: 10.0.26100 # GE WDK | |
| source: nuget | |
| llvm: | |
| - 17.0.6 | |
| rust_toolchain: | |
| - stable | |
| - beta | |
| - nightly | |
| cargo_profile: | |
| - dev | |
| - release | |
| target_triple: | |
| - name: x86_64-pc-windows-msvc | |
| arch: amd64 | |
| - name: aarch64-pc-windows-msvc | |
| arch: arm64 | |
| codeql: | |
| - language: c-cpp | |
| build-mode: manual | |
| - language: rust | |
| build-mode: none | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - name: Install Winget | |
| uses: ./.github/actions/install-winget | |
| - name: Install LLVM ${{ matrix.llvm }} | |
| uses: ./.github/actions/install-llvm | |
| with: | |
| version: ${{ matrix.llvm }} | |
| - name: Install WDK (${{ matrix.wdk.version }}) | |
| uses: ./.github/actions/install-wdk | |
| with: | |
| version: ${{ matrix.wdk.version }} | |
| source: ${{ matrix.wdk.source }} | |
| host: ${{ matrix.wdk.source == 'nuget' && 'amd64' || '' }} | |
| target: ${{ matrix.wdk.source == 'nuget' && matrix.target_triple.arch || '' }} | |
| - name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust_toolchain }} | |
| components: clippy | |
| targets: ${{ matrix.target_triple.name }} | |
| - name: Install Cargo Make | |
| uses: ./.github/actions/install-cargo-tool | |
| with: | |
| tool: cargo-make | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 | |
| with: | |
| languages: ${{ matrix.codeql.language }} | |
| build-mode: ${{ matrix.codeql.build-mode }} | |
| queries: security-extended,security-and-quality | |
| - if: matrix.codeql.build-mode == 'manual' | |
| working-directory: ./examples | |
| run: cargo +${{ matrix.rust_toolchain }} make default --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }} --workspace --all-features | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 | |
| with: | |
| category: "/language:${{matrix.codeql.language}}" |