From c025a56890585869d68155ef1e93d61d72e9ad3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 16 Oct 2026 14:04:09 +0200 Subject: [PATCH 1/2] ci: add CodeQL workflow building against PHP headers --- .github/workflows/codeql.yaml | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/codeql.yaml diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml new file mode 100644 index 0000000000..30adfa6e9c --- /dev/null +++ b/.github/workflows/codeql.yaml @@ -0,0 +1,72 @@ +--- +name: CodeQL +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} +on: + pull_request: + branches: + - main + paths-ignore: + - "docs/**" + push: + branches: + - main + paths-ignore: + - "docs/**" + schedule: + - cron: "17 4 * * 1" +permissions: + contents: read +env: + GOTOOLCHAIN: local + GOFLAGS: "-tags=nowatcher,nobadger,nomysql,nopgx" +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: c-cpp + build-mode: manual + - language: go + build-mode: manual + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - if: matrix.build-mode == 'manual' + uses: ./.github/actions/setup-go + with: + # A warm build cache skips the compiler calls the extractors trace + cache: "false" + - if: matrix.build-mode == 'manual' + uses: ./.github/actions/setup-php + - name: Reinstall libbrotli-dev + if: matrix.build-mode == 'manual' + # TODO: remove this workaround when fixed upstream + run: sudo apt-get install --reinstall -y libbrotli-dev + - name: Set CGO flags + if: matrix.build-mode == 'manual' + run: echo "CGO_CFLAGS=$(php-config --includes)" >> "${GITHUB_ENV}" + - uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + - name: Build + if: matrix.build-mode == 'manual' + run: go build ./... + - name: Build Caddy module + if: matrix.build-mode == 'manual' + working-directory: caddy/ + run: go build ./... + - uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0 + with: + category: /language:${{ matrix.language }} From 26dd1e30dcdbd6c9e172d25d329949c26d7746c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 16 Oct 2026 14:16:25 +0200 Subject: [PATCH 2/2] ci: install libbrotli-dev instead of reinstalling it --- .github/workflows/codeql.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 30adfa6e9c..8739a1dc0f 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -49,10 +49,9 @@ jobs: cache: "false" - if: matrix.build-mode == 'manual' uses: ./.github/actions/setup-php - - name: Reinstall libbrotli-dev + - name: Install libbrotli-dev if: matrix.build-mode == 'manual' - # TODO: remove this workaround when fixed upstream - run: sudo apt-get install --reinstall -y libbrotli-dev + run: sudo apt-get install -y libbrotli-dev - name: Set CGO flags if: matrix.build-mode == 'manual' run: echo "CGO_CFLAGS=$(php-config --includes)" >> "${GITHUB_ENV}"