From c989e67c58feaf42443344b331610ae534eef23e Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Fri, 7 Feb 2025 14:15:59 +0530 Subject: [PATCH] Update Code Coverage report publiscation in workflow templates --- .../workflows/build-connector-template.yml | 13 +++--- .../build-timestamp-master-template.yml | 7 +++- .../workflows/pr-build-connector-template.yml | 41 ++++++++++--------- .../workflows/pull-request-build-template.yml | 13 +++--- .github/workflows/release_pipeline.yml | 6 +++ .../s4hana-build-connector-template.yml | 11 +++-- .github/workflows/s4hana-pr-template.yml | 11 +++-- 7 files changed, 62 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-connector-template.yml b/.github/workflows/build-connector-template.yml index e54df861..ca6f1597 100644 --- a/.github/workflows/build-connector-template.yml +++ b/.github/workflows/build-connector-template.yml @@ -33,7 +33,7 @@ jobs: - name: Get Ballerina Version run: | - BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) + BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) if [ -z "$BAL_VERSION" ]; then BAL_VERSION="latest" fi @@ -60,10 +60,10 @@ jobs: updatedVersion=$VERSION-$startTime-$latestCommit echo $updatedVersion sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties - + - name: Set ENV Variables run: | - echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV + echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV - name: Build the Package env: @@ -73,8 +73,11 @@ jobs: ./gradlew build -x -PbuildUsingDocker="2201.11.0-pre-rc1" test ${{ inputs.additional-build-flags }} ./gradlew test -PbuildUsingDocker="2201.11.0-pre-rc1" ${{ inputs.additional-test-flags }} - - name: Generate Codecov Report - uses: codecov/codecov-action@v3 + - name: Generate CodeCov Report + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} - name: Publish Connector if: ${{ inputs.publish-required == true }} diff --git a/.github/workflows/build-timestamp-master-template.yml b/.github/workflows/build-timestamp-master-template.yml index f282bd5e..c7674ec7 100644 --- a/.github/workflows/build-timestamp-master-template.yml +++ b/.github/workflows/build-timestamp-master-template.yml @@ -36,7 +36,7 @@ jobs: - name: Set ENV Variables run: | - echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV + echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV - name: Build with Gradle env: @@ -47,7 +47,10 @@ jobs: run: ./gradlew publish --no-daemon --scan ${{ inputs.additional-build-flags }} - name: Generate CodeCov Report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} - name: Upload Artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/pr-build-connector-template.yml b/.github/workflows/pr-build-connector-template.yml index 1ef44378..d4c5dd1d 100644 --- a/.github/workflows/pr-build-connector-template.yml +++ b/.github/workflows/pr-build-connector-template.yml @@ -21,12 +21,12 @@ jobs: group: ${{ github.head_ref }}-ubuntu-build cancel-in-progress: true steps: - - name: Checkout Repository - uses: actions/checkout@v3 + - name: Checkout Repository + uses: actions/checkout@v3 - name: Get Ballerina Version run: | - BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) + BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) if [ -z "$BAL_VERSION" ]; then BAL_VERSION="latest" fi @@ -38,23 +38,26 @@ jobs: with: version: nightly - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 21.0.3 - + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 21.0.3 + - name: Set ENV Variables run: | - echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV + echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV - - name: Build the Package - env: - packageUser: ${{ github.actor }} - packagePAT: ${{ secrets.GITHUB_TOKEN }} - run: | - ./gradlew build -x test -PbuildUsingDocker="2201.11.0-pre-rc1" ${{ inputs.additional-build-flags }} - ./gradlew test -PbuildUsingDocker="2201.11.0-pre-rc1" ${{ inputs.additional-test-flags }} + - name: Build the Package + env: + packageUser: ${{ github.actor }} + packagePAT: ${{ secrets.GITHUB_TOKEN }} + run: | + ./gradlew build -x test -PbuildUsingDocker="2201.11.0-pre-rc1" ${{ inputs.additional-build-flags }} + ./gradlew test -PbuildUsingDocker="2201.11.0-pre-rc1" ${{ inputs.additional-test-flags }} - - name: Generate Codecov Report - uses: codecov/codecov-action@v3 + - name: Generate CodeCov Report + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} diff --git a/.github/workflows/pull-request-build-template.yml b/.github/workflows/pull-request-build-template.yml index 66dab26d..35c5bfc3 100644 --- a/.github/workflows/pull-request-build-template.yml +++ b/.github/workflows/pull-request-build-template.yml @@ -42,7 +42,7 @@ jobs: - name: Set ENV Variables run: | - echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV + echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV - name: Build the Package env: @@ -52,10 +52,11 @@ jobs: ./gradlew build -x test ${{ inputs.additional-ubuntu-build-flags }} ./gradlew test ${{ inputs.additional-ubuntu-test-flags }} - - name: Generate Codecov Report - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - name: Generate CodeCov Report + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} windows-build: name: Build on Windows @@ -75,7 +76,7 @@ jobs: - name: Set ENV Variables run: | - echo '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' | Out-File -FilePath $env:GITHUB_ENV -Append + echo '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' | Out-File -FilePath $env:GITHUB_ENV -Append - name: Build the Project env: diff --git a/.github/workflows/release_pipeline.yml b/.github/workflows/release_pipeline.yml index 82777729..a343b4d6 100644 --- a/.github/workflows/release_pipeline.yml +++ b/.github/workflows/release_pipeline.yml @@ -18,6 +18,11 @@ on: required: true default: false type: boolean + release_driver_modules: + description: 'Release Ballerina Driver Modules (ballerinax/mysql.driver, ballerinax/mssql.driver, etc.)' + required: true + default: false + type: boolean release_handwritten_connectors: description: 'Release Ballerina Handwritten Connectors (ballerinax/mongodb, ballerinax/mysql, etc.)' required: true @@ -47,6 +52,7 @@ jobs: RELEASE_LIBS: ${{ github.event.inputs.release_libs }} RELEASE_EXTENSIONS: ${{ github.event.inputs.release_extensions }} RELEASE_TOOLS: ${{ github.event.inputs.release_tools }} + RELEASE_DRIVER_MODULES: ${{ github.event.inputs.release_driver_modules }} RELEASE_HANDWRITTEN_CONNECTORS: ${{ github.event.inputs.release_handwritten_connectors }} RELEASE_GENERATED_CONNECTORS: ${{ github.event.inputs.release_generated_connectors }} BAL_CONFIG_VAR_WORKFLOW: "publish-release.yml" diff --git a/.github/workflows/s4hana-build-connector-template.yml b/.github/workflows/s4hana-build-connector-template.yml index f1ea0443..44b7ad4d 100644 --- a/.github/workflows/s4hana-build-connector-template.yml +++ b/.github/workflows/s4hana-build-connector-template.yml @@ -17,7 +17,7 @@ jobs: - name: Get Ballerina Version run: | - BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) + BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) if [ -z "$BAL_VERSION" ]; then BAL_VERSION="latest" fi @@ -59,7 +59,7 @@ jobs: if [[ "$dir" == resources ]]; then continue fi - folders+=("$dir"); + folders+=("$dir"); done echo "directories=$(jq -nc --args '$ARGS.positional' ${folders[@]})" >> $GITHUB_OUTPUT @@ -102,5 +102,8 @@ jobs: - name: Download coverage reports uses: actions/download-artifact@v4 - - name: Generate Codecov Report - uses: codecov/codecov-action@v3 + - name: Generate CodeCov Report + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} diff --git a/.github/workflows/s4hana-pr-template.yml b/.github/workflows/s4hana-pr-template.yml index c2c7e10b..894af9cd 100644 --- a/.github/workflows/s4hana-pr-template.yml +++ b/.github/workflows/s4hana-pr-template.yml @@ -25,7 +25,7 @@ jobs: if [[ "$dir" == resources ]]; then continue fi - folders+=("$dir"); + folders+=("$dir"); done echo "directories=$(jq -nc --args '$ARGS.positional' ${folders[@]})" >> $GITHUB_OUTPUT @@ -68,8 +68,11 @@ jobs: - name: Download coverage reports uses: actions/download-artifact@v4 - - name: Generate Codecov Report - uses: codecov/codecov-action@v3 + - name: Generate CodeCov Report + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ballerina-platform/${{ github.event.inputs.repo }} build-examples: name: Build Examples @@ -81,7 +84,7 @@ jobs: - name: Get Ballerina Version run: | - BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) + BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) if [ -z "$BAL_VERSION" ]; then BAL_VERSION="latest" fi