curl/.github/workflows/codeql.yml
Viktor Szakats cc50f05370
GHA/codeql: re-enable for C with the default query pack
Earlier we used `security-extended` and tried `security-and-quality`.
Try the default to see how it works.

CodeQL no longer uses the project's Actions cache, also fixing
the previously seen repeat cache entry issue.

- switch to `manual` build. It's 3x faster than the default `autobuild`.
- enable more dependencies to increase coverage.
- docs/tests/CI.md: re-add CodeQL.

Ref: https://docs.github.com/en/code-security/code-scanning/managing-your-code-scanning-configuration/codeql-query-suites
Ref: https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
Ref: #16263
Ref: 173805b2e7 #15798

Closes #18528
2025-09-12 11:03:44 +02:00

95 lines
2.3 KiB
YAML

# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'CodeQL'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
schedule:
- cron: '0 0 * * 4'
concurrency:
group: ${{ github.workflow }}
permissions: {}
jobs:
codeql:
name: 'GHA and Python'
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: 'initialize'
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3
with:
languages: actions, python
queries: security-extended
- name: 'perform analysis'
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3
c:
name: 'C'
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: 'install prereqs'
timeout-minutes: 5
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libbrotli-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: 'initialize'
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3
with:
languages: cpp
build-mode: manual
- name: 'build'
timeout-minutes: 10
run: |
cmake -B . -G Ninja
cmake --build . --verbose
src/curl -V
- name: 'perform analysis'
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3