-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from jenkinsci/stage-result
[JENKINS-72059] Add new quality gate options to alter the stage only
- Loading branch information
Showing
19 changed files
with
630 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: 'Quality badges' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
|
||
runs-on: [ubuntu-latest] | ||
name: Update quality badges | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
check-latest: true | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.6 | ||
- name: Build and test with Maven | ||
run: mvn -V --color always -ntp clean verify -Dgpg.skip -Ppit -Pdepgraph | tee maven.log | ||
- name: Run Quality Monitor | ||
uses: uhafner/quality-monitor@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Write metrics to GitHub output | ||
id: metrics | ||
run: | | ||
cat metrics.env >> "${GITHUB_OUTPUT}" | ||
mkdir -p badges | ||
- name: Generate the badge SVG image for the line coverage | ||
uses: emibcn/[email protected] | ||
with: | ||
label: 'Lines' | ||
status: ${{ steps.metrics.outputs.line }}% | ||
color: 'green' | ||
path: badges/line-coverage.svg | ||
- name: Generate the badge SVG image for the branch coverage | ||
uses: emibcn/[email protected] | ||
with: | ||
label: 'Branches' | ||
status: ${{ steps.metrics.outputs.branch }}% | ||
color: 'green' | ||
path: badges/branch-coverage.svg | ||
- name: Generate the badge SVG image for the mutation coverage | ||
uses: emibcn/[email protected] | ||
with: | ||
label: 'Mutations' | ||
status: ${{ steps.metrics.outputs.mutation }}% | ||
color: 'green' | ||
path: badges/mutation-coverage.svg | ||
- name: Generate the badge SVG image for the style warnings | ||
uses: emibcn/[email protected] | ||
with: | ||
label: 'Warnings' | ||
status: ${{ steps.metrics.outputs.style }} | ||
color: 'orange' | ||
path: badges/style.svg | ||
- name: Generate the badge SVG image for the bugs | ||
uses: emibcn/[email protected] | ||
with: | ||
label: 'Bugs' | ||
status: ${{ steps.metrics.outputs.bugs }} | ||
color: 'orange' | ||
path: badges/bugs.svg | ||
- name: Commit updated badges | ||
continue-on-error: true | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add badges/*.svg | ||
git commit -m "Update badges with results from latest autograding" || true | ||
git add doc/dependency-graph.puml | ||
git commit -m "Update dependency graph to latest versions from POM" || true | ||
- name: Push updated badges to GitHub repository | ||
uses: ad-m/github-push-action@master | ||
if: ${{ success() }} | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/io/jenkins/plugins/util/NullResultHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.jenkins.plugins.util; | ||
|
||
import hudson.model.Result; | ||
|
||
/** | ||
* A {@link ResultHandler} that does nothing. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
public class NullResultHandler implements ResultHandler { | ||
@Override | ||
public void publishResult(final QualityGateStatus status, final String message) { | ||
// empty | ||
} | ||
|
||
@Override | ||
public void publishResult(final Result result, final String message) { | ||
// empty | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.