Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/coverage badge #4260

Merged
merged 28 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
102a4bf
coverage_badge
Apr 13, 2023
99b51e5
added on pull for testing
Apr 13, 2023
40d71d5
chore: nightly coverage badge
github-actions[bot] Apr 13, 2023
2d9dbef
Update README.adoc
realMartinez Apr 13, 2023
fe6136b
Update README.adoc
realMartinez Apr 13, 2023
28b2b57
Update README.adoc
realMartinez Apr 14, 2023
fba25b2
Update README.adoc
realMartinez Apr 14, 2023
10a1ff4
Update README.adoc
realMartinez Apr 14, 2023
d212a1d
chore: nightly coverage badge
github-actions[bot] Apr 14, 2023
1f34181
changed coverage badge format to adoc
Apr 14, 2023
18cf634
Update README.adoc
realMartinez Apr 14, 2023
d7d5b72
Go Coverage Action edit
Apr 14, 2023
a1d2e96
Go Coverage Action edit
Apr 14, 2023
cab57f3
Coverage Badge Action edit
Apr 14, 2023
7a60e26
Go Coverage Badge edit
Apr 14, 2023
309dd67
Go Coverage Badge Action edit
Apr 14, 2023
b03c576
chore: nightly coverage badge
github-actions[bot] Apr 14, 2023
9c75a04
Added Conversion from md to adoc for badge
Apr 14, 2023
fd6922c
Go Coverage Badge action edit
Apr 14, 2023
c781281
Update README.adoc
realMartinez Apr 14, 2023
cbad792
Updated Regex in Convert Badge
Apr 14, 2023
3ffa8f1
Conver Badge to adoc edit
Apr 14, 2023
69aa919
chore: nightly coverage badge
github-actions[bot] Apr 14, 2023
f788da1
Update README.adoc
realMartinez Apr 14, 2023
253be89
chore: nightly coverage badge
github-actions[bot] Apr 14, 2023
3b0ca98
renamed badge coverage workflow
Apr 14, 2023
ab47fda
Update README.adoc
realMartinez Apr 14, 2023
f65a6db
Changed Push changes action
Apr 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/nightly-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# ---------------------------------------------------------------------------
# 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: coverage

on:
schedule:
- cron: '45 1 * * *'
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-20.04
name: Update Coverage Badge
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.18'
check-latest: true

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run Test
run: |
go test -v ./... -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out
touch badge.out

- name: Go Coverage Badge

uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage.out
target: badge.out

- name: Convert Badge to adoc
run: |
replacement=$(grep -o 'https://[^)]*' badge.out)
target="(?:https:\/\/img\.shields\.io\/badge\/Coverage).*?(?=\.svg)"
perl -i -pe "s|${target}|${replacement}|g" README.adoc


- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-files
with:
files: README.adoc

- name: Commit changes
shell: bash
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add -A && git commit -m 'chore: nightly coverage badge' && echo "refresh=1" >> $GITHUB_ENV || echo "No changes to make update-docs"

- name: Push changes
shell: bash
if: env.changelog == 1 || env.refresh == 1
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://$CI_USER:[email protected]/$GITHUB_REPOSITORY.git" '${{ github.ref_name }}'
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ image:https://github.com/apache/camel-k/workflows/kubernetes/badge.svg["Kubernet
image:https://github.com/apache/camel-k/workflows/knative/badge.svg["Knative", link="https://github.com/apache/camel-k/actions/workflows/knative.yml"]
image:https://github.com/apache/camel-k/actions/workflows/nightly-release.yml/badge.svg["Nightly releases", link="https://github.com/apache/camel-k/actions/workflows/nightly-release.yml"]
image:https://github.com/apache/camel-k/actions/workflows/nightly-native-test.yml/badge.svg["Quarkus native", link="https://github.com/apache/camel-k/actions/workflows/nightly-native-test.yml"]
image:https://img.shields.io/badge/Coverage-39.6%25-yellow.svg["Go coverage", link="https://github.com/apache/camel-k/actions/workflows/nightly-coverage.yml"]
image:https://img.shields.io/badge/zulip-join_chat-brightgreen.svg["Chat on Zulip", link="https://camel.zulipchat.com"]

Apache Camel K is a lightweight integration framework built from **Apache Camel** that runs natively on Kubernetes and is specifically designed for serverless and microservice architectures. Users of `Camel K` can instantly run integration code written in Camel DSL on their preferred **Cloud** provider.
Expand Down