From 17f3784dd5177ed9dddc844d9b5cdc81789f2967 Mon Sep 17 00:00:00 2001 From: Marco Magdy Date: Sat, 15 Oct 2022 18:41:25 -0700 Subject: [PATCH 1/4] Add support for Github code scanner 'lgtm.com' is shutting down in December 2022. It has been replaced by 'GitHub code scanning'. --- .github/workflows/code-quality.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000..ea73be4 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,53 @@ +name: "Code Quality" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '32 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' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + - run: | + echo "Run, CMake build script" + cmake -B ${{github.workspace}}/build -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" + From 7fbb003ee642dc3d5cab66fc770012651bb4cef0 Mon Sep 17 00:00:00 2001 From: Marco Magdy Date: Sat, 15 Oct 2022 18:56:06 -0700 Subject: [PATCH 2/4] Install libcurl as part of the build steps --- .github/workflows/code-quality.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ea73be4..9ccfc82 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -29,6 +29,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + # Install libcurl dependency + - name: Install dependencies + run: sudo apt install -y libcurl4-openssl-dev + + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 @@ -44,7 +49,7 @@ jobs: - run: | echo "Run, CMake build script" - cmake -B ${{github.workspace}}/build -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF + cmake -B ${{github.workspace}}/build -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From e65c552b21393f9ba8ad6b96341fce6748b8f153 Mon Sep 17 00:00:00 2001 From: Marco Magdy Date: Sat, 15 Oct 2022 19:06:46 -0700 Subject: [PATCH 3/4] Replace lgtm badge with GitHub code analyzer --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f86004a..1e7828b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![GitHub](https://img.shields.io/github/license/awslabs/aws-lambda-cpp.svg)](https://github.com/awslabs/aws-lambda-cpp/blob/master/LICENSE) -[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/awslabs/aws-lambda-cpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/awslabs/aws-lambda-cpp/context:cpp) + +![Code Quality badge](https://github.com/awslabs/aws-lambda-cpp/actions/workflows/code-quality.yml/badge.svg) | OS | Arch | Status | |----|------|--------| From 80cd4dd57abaf42265a504d86d8ee5d6ba59be1b Mon Sep 17 00:00:00 2001 From: Marco Magdy Date: Sat, 15 Oct 2022 20:20:45 -0700 Subject: [PATCH 4/4] fixup! Replace lgtm badge with GitHub code analyzer --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1e7828b..74e60af 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![GitHub](https://img.shields.io/github/license/awslabs/aws-lambda-cpp.svg)](https://github.com/awslabs/aws-lambda-cpp/blob/master/LICENSE) - ![Code Quality badge](https://github.com/awslabs/aws-lambda-cpp/actions/workflows/code-quality.yml/badge.svg) | OS | Arch | Status |