You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by mm...@apache.org on 2024/02/07 19:07:09 UTC

(bookkeeper) branch merlimat-patch-1 created (now cf06328a5f)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a change to branch merlimat-patch-1
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


      at cf06328a5f Enable CodeQL static code scanner

This branch includes the following new commits:

     new cf06328a5f Enable CodeQL static code scanner

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(bookkeeper) 01/01: Enable CodeQL static code scanner

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch merlimat-patch-1
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit cf06328a5f8cc070f5d58ff32afd9a59c451d0d1
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Wed Feb 7 11:07:04 2024 -0800

    Enable CodeQL static code scanner
---
 .github/workflows/codeql.yml | 101 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 101 insertions(+)

diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000000..19b6393ee5
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,101 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "CodeQL"
+
+on:
+  push:
+    branches: [ "master" ]
+  pull_request:
+    branches: [ "master" ]
+  schedule:
+    - cron: '27 11 * * 6'
+
+jobs:
+  analyze:
+    name: Analyze
+    runs-on: 'ubuntu-latest'
+    timeout-minutes: 360
+    permissions:
+      # required for all workflows
+      security-events: write
+
+      # only required for workflows in private repositories
+      actions: read
+      contents: read
+
+    strategy:
+      fail-fast: false
+      matrix:
+        language: [ 'c-cpp', 'java-kotlin', 'python' ]
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v4
+
+    - name: Detect changed files
+      id: changes
+      uses: apache/pulsar-test-infra/paths-filter@master
+      with:
+        filters: .github/changes-filter.yaml
+        list-files: csv
+
+    - name: Check changed files
+      id: check_changes
+      run: |
+        echo "docs_only=${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}" >> $GITHUB_OUTPUT
+
+    - name: Cache local Maven repository
+      if: steps.check_changes.outputs.docs_only != 'true'
+      id: cache
+      uses: actions/cache@v3
+      with:
+        path: |
+          ~/.m2/repository/*/*/*
+          !~/.m2/repository/org/apache/bookkeeper
+          !~/.m2/repository/org/apache/distributedlog
+        key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v3
+      with:
+        languages: ${{ matrix.language }}
+
+    - name: Set up JDK 11
+      if: steps.check_changes.outputs.docs_only != 'true'
+      uses: actions/setup-java@v2
+      with:
+        distribution: 'temurin'
+        java-version: 11
+
+    - name: Set up Maven
+      uses: apache/pulsar-test-infra/setup-maven@master
+      with:
+        maven-version: 3.8.7
+
+    - name: Validate pull request
+      if: steps.check_changes.outputs.docs_only != 'true'
+      run: |
+        mvn -T 1C -B -nsu clean install -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
+
+    - name: Perform CodeQL Analysis
+      if: steps.check_changes.outputs.docs_only != 'true'
+      uses: github/codeql-action/analyze@v3
+      with:
+        category: "/language:${{matrix.language}}"