From 76fc4a0e6e5470396bbf9a2c813d537f295ecc5e Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 08:41:20 -0600 Subject: [PATCH 1/8] Add GRADLE_ENTERPRISE_ACCESS_KEY to a couple of Gradle builds missing it --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2123d1ba36..890ab58a75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,8 @@ jobs: - name: GenerateGrammarSource run: ./gradlew clean generateGrammarSource --parallel --daemon + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 @@ -107,3 +109,5 @@ jobs: - name: Check third party dependencies run: | ./gradlew clean dist -x spotlessJava -x test -x checkstyleMain -x javaDoc && ./gradlew installPlugin && ./gradlew tar && sh tools/dependency-check/check-dependencies.sh && echo "Thirty party dependencies check success" + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} From fbfe3d01d3cd29ac9918dc6c971e25e0e787d0fa Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 08:41:59 -0600 Subject: [PATCH 2/8] Update to most recent Gradle Enterprise Gradle Plugin --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 3e8647cf0e..645e6fb365 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,7 +16,7 @@ */ plugins { - id 'com.gradle.enterprise' version '3.15.1' + id 'com.gradle.enterprise' version '3.16.1' id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.12.1' } From 3a79ae1ff23ff313e6a7043b391ce9e054ec00e1 Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 08:42:15 -0600 Subject: [PATCH 3/8] Move CodeQL verification to its own worfklow --- .github/workflows/ci.yml | 20 ----------- .github/workflows/codeql.yml | 69 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 890ab58a75..2845390ac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,29 +33,12 @@ jobs: matrix: os: [ ubuntu-latest, macOS-latest ] java: [ 8, 11 ] - language: ['java', 'go'] runs-on: ${{ matrix.os }} steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - # 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. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - languages: ${{ matrix.language }} - - - if: matrix.language == 'cpp' || matrix.language == 'csharp' - name: Build C - run: | - git submodule init - git submodule update - make -C ./eventmesh-sdks/eventmesh-sdk-c - - name: Setup Gradle uses: gradle/gradle-build-action@v2 @@ -87,9 +70,6 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v2 - - name: Upload coverage report to codecov.io run: bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..a9540ae8a0 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,69 @@ +# +# 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: [ '*' ] + pull_request: + branches: [ '*' ] + +jobs: + build: + name: Build + strategy: + fail-fast: false + matrix: + language: ['java', 'go'] + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + # 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. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + languages: ${{ matrix.language }} + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + if: matrix.language == 'java' + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + if: matrix.language == 'java' + + # https://docs.gradle.org/current/userguide/performance.html + - name: Build + run: ./gradlew clean assemble compileTestJava --no-build-cache --parallel --daemon + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + if: matrix.language == 'java' + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v2 From 74ade42c03ba3a2ade031b1493e0e12a7e056498 Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 12:07:06 -0600 Subject: [PATCH 4/8] Rename CodeQL workflow to "Analyze" --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a9540ae8a0..ac56902383 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ # under the License. # -name: "CodeQL" +name: "Analyze" on: push: From 99dfc6fb9155286b4a667426d10b6852faf2cefa Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 12:07:55 -0600 Subject: [PATCH 5/8] Rename "Build" workflow to "Docker" --- .github/workflows/{build.yaml => docker.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build.yaml => docker.yaml} (99%) diff --git a/.github/workflows/build.yaml b/.github/workflows/docker.yaml similarity index 99% rename from .github/workflows/build.yaml rename to .github/workflows/docker.yaml index 68ca1799cc..ab49c8204e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/docker.yaml @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # -name: Build +name: Docker on: release: types: [released] From f33a369aa9d91a24fe3ee1a1c585e2ec1feccb65 Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 12:52:40 -0600 Subject: [PATCH 6/8] Restore the language matrix with 'java' as the only language in ci workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2845390ac7..f90fc9e1c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: matrix: os: [ ubuntu-latest, macOS-latest ] java: [ 8, 11 ] + language: ['java'] runs-on: ${{ matrix.os }} steps: From 78315dee8fbc544ca61b887f0b663ce432536d48 Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 12:53:08 -0600 Subject: [PATCH 7/8] Return the cpp/csharp language step in ci workflow --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f90fc9e1c8..e6018573c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - if: matrix.language == 'cpp' || matrix.language == 'csharp' + name: Build C + run: | + git submodule init + git submodule update + make -C ./eventmesh-sdks/eventmesh-sdk-c + - name: Setup Gradle uses: gradle/gradle-build-action@v2 From fc4a7b8eb68eef62db12547ced5552e0590f031d Mon Sep 17 00:00:00 2001 From: Clay Johnson Date: Fri, 12 Jan 2024 13:28:00 -0600 Subject: [PATCH 8/8] Rename CodeQL job to "Analyze" rather than "Build" --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ac56902383..d8a345a39f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ # under the License. # -name: "Analyze" +name: "CodeQL" on: push: @@ -27,7 +27,7 @@ on: jobs: build: - name: Build + name: Analyze strategy: fail-fast: false matrix: