diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..bfa8c68 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,17 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: false diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..14a4489 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,29 @@ +name: 'Generate Coverage Report' + +on: + push: + branches: + - master + pull_request: + +jobs: + coverage: + runs-on: ubuntu-latest + name: Coverage on Ubuntu + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true + cache: 'maven' + - name: Generate coverage with JaCoCo + run: mvn clean verify jacoco:prepare-agent test integration-test jacoco:report + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./target/site/jacoco/jacoco.xml diff --git a/.github/workflows/jenkins-security-scan.yml b/.github/workflows/jenkins-security-scan.yml new file mode 100644 index 0000000..1f02417 --- /dev/null +++ b/.github/workflows/jenkins-security-scan.yml @@ -0,0 +1,21 @@ +name: Jenkins Security Scan + +on: + push: + branches: + - master + pull_request: + types: [ opened, synchronize, reopened ] + workflow_dispatch: + +permissions: + security-events: write + contents: read + actions: read + +jobs: + security-scan: + uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2 + with: + java-cache: '' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate. + java-version: 17 # What version of Java to set up for the build. diff --git a/README.md b/README.md index 93956ab..4092482 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # Badge plugin +[![Build Status](https://ci.jenkins.io/job/Plugins/job/badge-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/badge-plugin/job/master/) +[![Codecov Coverage](https://codecov.io/gh/jenkinsci/badge-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/jenkinsci/badge-plugin) +[![Jenkins Security Scan](https://github.com/jenkinsci/badge-plugin/actions/workflows/jenkins-security-scan.yml/badge.svg)](https://github.com/jenkinsci/badge-plugin/actions/workflows/jenkins-security-scan.yml) + +[![Installations](https://img.shields.io/jenkins/plugin/i/badge.svg?color=blue&label=installations)](https://stats.jenkins.io/pluginversions/badge.html) +[![Contributors](https://img.shields.io/github/contributors/jenkinsci/badge-plugin.svg?color=blue)](https://github.com/jenkinsci/badge-plugin/graphs/contributors) +[![Changelog](https://img.shields.io/github/release/jenkinsci/badge-plugin.svg?label=changelog)](https://github.com/jenkinsci/badge-plugin/releases/latest) + Jenkins plugin to add badges and build summary entries from a pipeline. This plugin was forked from the [Groovy Postbuild Plugin](https://plugins.jenkins.io/groovy-postbuild) which will in future use the API from this plugin. diff --git a/src/test/resources/readme/README.tmpl b/src/test/resources/readme/README.tmpl index 3fc705e..d5ab0eb 100644 --- a/src/test/resources/readme/README.tmpl +++ b/src/test/resources/readme/README.tmpl @@ -1,5 +1,13 @@ # Badge plugin +[![Build Status](https://ci.jenkins.io/job/Plugins/job/badge-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/badge-plugin/job/master/) +[![Codecov Coverage](https://codecov.io/gh/jenkinsci/badge-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/jenkinsci/badge-plugin) +[![Jenkins Security Scan](https://github.com/jenkinsci/badge-plugin/actions/workflows/jenkins-security-scan.yml/badge.svg)](https://github.com/jenkinsci/badge-plugin/actions/workflows/jenkins-security-scan.yml) + +[![Installations](https://img.shields.io/jenkins/plugin/i/badge.svg?color=blue&label=installations)](https://stats.jenkins.io/pluginversions/badge.html) +[![Contributors](https://img.shields.io/github/contributors/jenkinsci/badge-plugin.svg?color=blue)](https://github.com/jenkinsci/badge-plugin/graphs/contributors) +[![Latest Version](https://img.shields.io/github/release/jenkinsci/badge-plugin.svg?label=changelog)](https://github.com/jenkinsci/badge-plugin/releases/latest) + Jenkins plugin to add badges and build summary entries from a pipeline. This plugin was forked from the [Groovy Postbuild Plugin](https://plugins.jenkins.io/groovy-postbuild) which will in future use the API from this plugin.