summaryrefslogtreecommitdiff
path: root/neozip/.github/workflows/codeql.yml
blob: 972c694487dad8255240e42c8c7d3010a53c3d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: CodeQL
on:
  workflow_call:
  workflow_dispatch:
  schedule:
    - cron: "27 17 * * 0"

jobs:
  analyze:
    name: CodeQL (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        # https://codeql.github.com/docs/codeql-overview/system-requirements/
        os:
          - ubuntu-latest
          - macos-latest
          - macos-26-intel
          - windows-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          show-progress: 'false'

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v4
        with:
          languages: cpp
          queries: +security-and-quality

      - name: Build default config
        shell: bash
        run: |
          cmake -B build-default -S . ${{ runner.os == 'Windows' && '-A x64' || '' }}
          cmake --build build-default -j4

      - name: Build compat config without optim/strategies, with reduced mem
        shell: bash
        run: |
          cmake -B build-compat -S . -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_REDUCED_MEM=ON ${{ runner.os == 'Windows' && '-A x64' || '' }}
          cmake --build build-compat -j4

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v4
        with:
          category: "/oss:${{ matrix.os }}"