From 83585fbc7f8eb333168c117e01b110e18ee320ed Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Tue, 6 Aug 2024 13:45:01 +0200 Subject: [PATCH] * Create codeql.yml * Remove old workflow --- .github/workflows/codeql.yml | 59 +++++++++++++++++++ .../workflows/codeql-analysis.yml | 43 -------------- 2 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/codeql.yml delete mode 100644 .github_workflow/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..db17447 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,59 @@ +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '30 12 * * 5' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ubuntu:24.04 + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: manual + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - if: matrix.build-mode == 'manual' + shell: bash + run: | + sudo apt update && DEBIAN_FRONTEND=noninteractive sudo apt -y install git gcc clang cmake libgcrypt20-dev libgtk-3-dev libzip-dev libjansson-dev libpng-dev libzbar-dev libprotobuf-c-dev libsecret-1-dev uuid-dev libprotobuf-dev libqrencode-dev + git clone https://github.com/paolostivanin/OTPClient ./OTPClient + cd OTPClient && mkdir build && cd $_ + cmake .. + make + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github_workflow/workflows/codeql-analysis.yml b/.github_workflow/workflows/codeql-analysis.yml deleted file mode 100644 index 8ee6e60..0000000 --- a/.github_workflow/workflows/codeql-analysis.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '30 13 * * 1' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu:24.04 - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Install Dependencies - run: | - sudo apt update && DEBIAN_FRONTEND=noninteractive sudo apt -y install git gcc clang cmake libgcrypt20-dev libgtk-3-dev libzip-dev libjansson-dev libpng-dev libzbar-dev libprotobuf-c-dev libsecret-1-dev uuid-dev libprotobuf-dev libqrencode-dev libcotp-dev - git clone https://github.com/paolostivanin/OTPClient ./OTPClient - - - name: Build - run: | - cd OTPClient && mkdir build && cd $_ - cmake .. - make - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3