diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..2c9ee9f3 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,64 @@ +name: "CodeQL" + +on: + pull_request: + branches: [master] + +jobs: + analyze: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: 'c-cpp' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libcmocka-dev libcurl4-openssl-dev libgcrypt20-dev libglib2.0-dev \ + libgpgme-dev libgtk-3-dev libmicrohttpd-dev libncursesw5-dev \ + libnotify-dev libotr5-dev libreadline-dev libsignal-protocol-c-dev \ + libomemo-c-dev libssl-dev libtool libxss-dev meson ninja-build \ + pkg-config python3-dev python-dev-is-python3 libsqlite3-dev \ + libgdk-pixbuf-2.0-dev libqrencode-dev libenchant-2-dev \ + autoconf autoconf-archive automake cmake expect + + - name: Install stabber and libstrophe + run: | + git clone --depth 1 https://github.com/profanity-im/stabber /tmp/stabber + cd /tmp/stabber && ./bootstrap.sh && ./configure --prefix=/usr && make -j$(nproc) && sudo make install + + git clone --depth 1 https://github.com/strophe/libstrophe /tmp/libstrophe + cd /tmp/libstrophe && ./bootstrap.sh && ./configure --prefix=/usr && make -j$(nproc) && sudo make install + + - name: Build for Analysis + run: | + meson setup build_codeql \ + -Dnotifications=enabled \ + -Dpython-plugins=enabled \ + -Dc-plugins=enabled \ + -Dotr=enabled \ + -Dpgp=enabled \ + -Domemo=enabled \ + -Domemo-qrcode=enabled \ + -Dicons-and-clipboard=enabled \ + -Dgdk-pixbuf=enabled \ + -Dxscreensaver=enabled \ + -Dspellcheck=enabled \ + -Dtests=false + meson compile -C build_codeql + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:c-cpp"