diff --git a/.github/actions/automatic-updates/action.yml b/.github/actions/automatic-updates/action.yml index 5adbb7bec0..6672b9a931 100644 --- a/.github/actions/automatic-updates/action.yml +++ b/.github/actions/automatic-updates/action.yml @@ -63,7 +63,7 @@ runs: make generate codegen update-docs # Coverage badge - - name: Run Test + - name: Run Test and get coverage badge shell: bash run: | go test -v ./... -covermode=count -coverprofile=coverage.out @@ -76,11 +76,9 @@ runs: go tool cover -func=coverage.mod.out -o=coverage.mod.out grep -o -P '(?<=\(statements\))(.+)(?=%)' coverage.mod.out | xargs > coverage touch badge.out - - name: Go coverage badge - uses: ./.github/actions/coverage-badge - with: - filename: coverage.out - target: badge.out + wget https://gobinaries.com/github.com/AlexBeauchemin/gobadge@v0.2.0 -O gobadge + gobadge -filename=coverage -target=badge.out + - name: Convert badge to adoc shell: bash run: | diff --git a/.github/actions/coverage-badge/action.yml b/.github/actions/coverage-badge/action.yml deleted file mode 100644 index a2bc02168a..0000000000 --- a/.github/actions/coverage-badge/action.yml +++ /dev/null @@ -1,48 +0,0 @@ -# --------------------------------------------------------------------------- -# 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: Go Coverage Badge -description: Generate coverage badge for go projects -inputs: - filename: - description: 'File containing the tests output' - required: true - default: coverage.out - target: - description: 'Target file (default "README.md")' - required: false - -runs: - using: 'composite' - steps: - - run: | - EXTRA_ARGS="" - - if [[ -n '${{ inputs.target }}' ]]; then - EXTRA_ARGS+="-target=${{ inputs.target }}" - fi - - TEMP_DIR=$(mktemp -d) - curl -sf https://gobinaries.com/github.com/AlexBeauchemin/gobadge@v0.2.0 | PREFIX=$TEMP_DIR sh - $TEMP_DIR/gobadge -filename=${{ inputs.filename }} $EXTRA_ARGS - rm -rf $TEMP_DIR - id: coverage-badge-go - shell: bash - -branding: - icon: check-circle - color: white \ No newline at end of file