From ba0138da6b8b1acd6090e729b3901e7d64a4c27b Mon Sep 17 00:00:00 2001 From: Abhinav Agarwal Date: Mon, 18 May 2026 20:53:50 -0700 Subject: [PATCH] ci: add CodeQL static analysis Run the security-extended suite on the C code using a manual meson build. Triggers on push and PR to master, weekly, and on demand. --- .github/workflows/codeql.yml | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..989434dc --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,55 @@ +name: CodeQL + +on: + push: + branches: [master] + pull_request: + branches: [master] + schedule: + - cron: '27 4 * * 1' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze C + runs-on: ubuntu-24.04 + timeout-minutes: 30 + permissions: + contents: read + security-events: write + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + + - name: Initialize CodeQL + uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3 + with: + languages: c-cpp + build-mode: manual + queries: security-extended + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc ninja-build pkg-config libglib2.0-dev libfuse3-dev + pip3 install meson + + - name: Build + run: | + meson setup build --buildtype=debug + ninja -C build sshfs + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3