| | name: "CodeQL" |
| |
|
| | on: |
| | push: |
| | branches: [ 'master' ] |
| | pull_request: |
| | |
| | branches: [ 'master' ] |
| | schedule: |
| | - cron: '59 14 * * 2' |
| |
|
| | jobs: |
| | analyze: |
| | name: Analyze |
| |
|
| | runs-on: ubuntu-latest |
| |
|
| | permissions: |
| | actions: read |
| | contents: read |
| | security-events: write |
| |
|
| | strategy: |
| | fail-fast: false |
| | matrix: |
| | language: [ 'cpp' ] |
| | |
| | |
| | |
| | |
| |
|
| | steps: |
| | - name: Checkout code |
| | uses: actions/checkout@main |
| | with: |
| | fetch-depth: 0 |
| |
|
| | - name: Install Qt6 |
| | uses: jurplel/install-qt-action@v4 |
| | with: |
| | aqtversion: '==3.1.*' |
| | version: '6.9.*' |
| | host: 'linux' |
| | target: 'desktop' |
| | arch: 'linux_gcc_64' |
| | modules: 'qtwaylandcompositor' |
| |
|
| | - name: Install Qt and dependencies |
| | run: | |
| | sudo apt-get -y update |
| | # ubuntu jammy(22.04) libqt6core5compat6-dev |
| | # ubuntu nobel(24.04) qt6-5compat-dev |
| | sudo apt-get -qq install qtchooser libqt6core5compat6-dev libgl-dev libmuparser-dev libboost-dev librsvg2-bin libfreetype6-dev libicu-dev pkg-config libfuse2 |
| | sudo ln -snf /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf |
| | sudo rm -rf /usr/local/lib/android |
| | |
| | - name: Install Clang |
| | run: | |
| | sudo apt-get -qq install clang-15 clang-tools-15 |
| | |
| | |
| | - name: Initialize CodeQL |
| | uses: github/codeql-action/init@v3 |
| | with: |
| | languages: ${{ matrix.language }} |
| | |
| | |
| | |
| |
|
| | |
| | |
| |
|
| |
|
| | - name: Build |
| | run: | |
| | export CC=g++ |
| | qmake6 -r librecad.pro CONFIG+=debug_and_release PREFIX=/usr |
| | make release -j$(nproc) |
| | |
| | - name: Perform CodeQL Analysis |
| | uses: github/codeql-action/analyze@v3 |
| | with: |
| | category: "/language:${{matrix.language}}" |
| |
|
| | |
| | ClangScan: |
| | name: Security scan |
| | runs-on: ubuntu-latest |
| | steps: |
| | - name: Checkout code |
| | uses: actions/checkout@main |
| | with: |
| | fetch-depth: 0 |
| |
|
| | - name: Install Qt6 |
| | uses: jurplel/install-qt-action@v4 |
| | with: |
| | aqtversion: '==3.1.*' |
| | version: '6.9.0' |
| | host: 'linux' |
| | target: 'desktop' |
| | arch: 'linux_gcc_64' |
| | modules: 'qtwaylandcompositor' |
| |
|
| | - name: Install dependencies |
| | run: | |
| | sudo apt-get -y update |
| | sudo apt-get -qq install \ |
| | libgl-dev libmuparser-dev libboost-dev librsvg2-bin libfreetype6-dev libicu-dev pkg-config libfuse2 |
| | sudo rm -rf /usr/local/lib/android |
| | |
| | - name: Install Clang |
| | run: | |
| | sudo apt-get -qq install clang-15 clang-tools-15 |
| | |
| | - name: Build and analyze |
| | run: | |
| | export CC=g++ |
| | export ANALYZE="scan-build-15 -o out --use-cc=g++ --use-analyzer=/usr/bin/clang++ " |
| | ${ANALYZE}qmake6 -r librecad.pro CONFIG+=debug_and_release PREFIX=/usr |
| | ${ANALYZE}make release -j$(nproc) |
| | |
| | - name: Create report repository |
| | run: | |
| | cd out |
| | find . -mindepth 2 -type f -print -exec mv {} . \; |
| | git config --global user.email "github@librecad.org" |
| | git config --global user.name "GHA CI [bot]" |
| | git config --global init.defaultBranch gh-pages |
| | git init |
| | git add . |
| | git commit -m "latest analyzer report" |
| | |
| | - name: Push changes |
| | if: github.repository_owner == 'LibreCAD' |
| | uses: ad-m/github-push-action@master |
| | with: |
| | repository: ${{github.repository_owner}}/static-analyzer-reports |
| | github_token: ${{secrets.LC_PUSH_ANALYZER_REPORT}} |
| | branch: gh-pages |
| | force: true |
| | directory: out |
| |
|