Update codeql.yml #4
This file contains 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: [ "test" ] | |
pull_request: | |
branches: [ "test" ] | |
schedule: | |
- cron: '37 9 * * 2' | |
env: | |
WINDIVERT_URL: https://reqrypt.org/download/WinDivert-2.2.0-D.zip | |
WINDIVERT_NAME: WinDivert-2.2.0-D.zip | |
WINDIVERT_BASENAME: WinDivert-2.2.0-D | |
WINDIVERT_SHA256: 1d461cfdfa7ba88ebcfbb3603b71b703e9f72aba8aeff99a75ce293e6f89d2ba | |
jobs: | |
analyze: | |
name: Analyze (${{ matrix.language }}) | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
packages: read | |
actions: read | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- language: c-cpp | |
build-mode: autobuild | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install MinGW-w64 | |
run: | | |
sudo rm /var/lib/man-db/auto-update | |
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends gcc-mingw-w64 | |
- name: Download WinDivert from cache | |
id: windivert-cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.WINDIVERT_BASENAME }} | |
key: ${{ env.WINDIVERT_SHA256 }} | |
- name: Download WinDivert from the website | |
if: steps.windivert-cache.outputs.cache-hit != 'true' | |
run: | | |
wget ${{ env.WINDIVERT_URL }} -O ${{ env.WINDIVERT_NAME }} | |
echo "${{ env.WINDIVERT_SHA256 }} ${{ env.WINDIVERT_NAME }}" | sha256sum -c | |
- name: Unpack WinDivert | |
run: | | |
unzip ${{ env.WINDIVERT_NAME }} -d ${{ env.WINDIVERT_BASENAME }} | |
sudo cp -r ${{ env.WINDIVERT_BASENAME }}/WinDivert-2.2.0-D/include/* /usr/share/mingw-w64/include/ | |
sudo cp -r ${{ env.WINDIVERT_BASENAME }}/WinDivert-2.2.0-D/x64/* /usr/share/mingw-w64/lib/ | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
build-mode: ${{ matrix.build-mode }} | |
- name: Build project | |
run: | | |
make -j4 CFLAGS="-I/usr/share/mingw-w64/include" LDFLAGS="-L/usr/share/mingw-w64/lib" | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{ matrix.language }}" |