From 614a81e62d247453758c56a2e542d52d8b2779fb Mon Sep 17 00:00:00 2001 From: Quim Muntal Date: Tue, 26 Mar 2024 18:49:25 +0100 Subject: [PATCH] Create codeql.yml (#66) * Create codeql.yml * add c build system * add makefile comment * generate an object file instead of a library * add missing EOF * use wildcard to select all c files * Use ubuntu-22.04 * add Makefile echo * Update Makefile --------- Co-authored-by: George Adams --- .github/workflows/codeql.yml | 45 ++++++++++++++++++++++++++++++++++++ .gitignore | 1 + Makefile | 4 ++++ 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/codeql.yml create mode 100644 Makefile diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..a9c9326 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,45 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: 19 21 * * 6 + +jobs: + analyze: + name: Analyze + # 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 + # Consider using larger runners for possible analysis time improvements. + runs-on: ubuntu-22.04 + timeout-minutes: 360 + permissions: + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'c-cpp', 'go' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: /language:${{matrix.language}} diff --git a/.gitignore b/.gitignore index 66fd13c..edf95e7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.dll *.so *.dylib +*.o # Test binary, built with `go test -c` *.test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..838586a --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +# Purpose: Makefile for building the C code for CodeQL analysis. +build: + cc -c openssl/*.c + echo "This task is only useful for CodeQL analysis. You don't need to run it."