Merge pull request #1548 from jenkinsci/renovate/net.sf.saxon-saxon-h… #569
This file contains hidden or 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
| name: 'Quality Badges' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| coverage: | |
| runs-on: [ubuntu-latest] | |
| name: Update quality badges | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| check-latest: true | |
| cache: 'maven' | |
| - name: Set up Maven | |
| uses: stCarolas/setup-maven@v5 | |
| with: | |
| maven-version: 3.9.16 | |
| - name: Check if quality monitor reports mutation coverage | |
| run: | | |
| FILE='.github/quality-monitor.json' | |
| PATTERN='target/pit-reports/mutations.xml' | |
| if [ -f "$FILE" ]; then | |
| if grep -q "$PATTERN" "$FILE"; then | |
| echo "PIT=-Ppit" >> "$GITHUB_ENV" | |
| fi | |
| fi | |
| - name: Cache the NVD database | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository/org/owasp/dependency-check-data | |
| key: dependency-check | |
| - name: Build and test with Maven | |
| env: | |
| NVD_API_KEY: ${{ secrets.NVD_API_KEY }} | |
| OSS_INDEX_TOKEN: ${{ secrets.OSS_INDEX_TOKEN }} | |
| PIT: ${{ env.PIT }} | |
| run: | | |
| mvn -V --color always -ntp clean verify -Pci $PIT -Powasp -Pdepgraph | tee maven.log | |
| if [ "${PIPESTATUS[0]}" != "0" ]; then | |
| exit 1; | |
| fi | |
| touch target/dependency-check-report.json | |
| - name: Read Quality Monitor Configuration | |
| id: quality-monitor | |
| run: echo "json=$(jq -c . .github/quality-monitor.json)" >> "$GITHUB_OUTPUT" | |
| - name: Run Quality Monitor | |
| uses: uhafner/quality-monitor@v4 | |
| with: | |
| config: ${{ steps.quality-monitor.outputs.json }} | |
| comments-strategy: ADD | |
| title-metric: none | |
| - 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/badge-action@v2.0.4 | |
| 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/badge-action@v2.0.4 | |
| with: | |
| label: 'Branches' | |
| status: ${{ steps.metrics.outputs.branch }}% | |
| color: 'green' | |
| path: badges/branch-coverage.svg | |
| - name: Generate the badge SVG image for the style warnings | |
| uses: emibcn/badge-action@v2.0.4 | |
| 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/badge-action@v2.0.4 | |
| with: | |
| label: 'Bugs' | |
| status: ${{ steps.metrics.outputs.bugs }} | |
| color: 'orange' | |
| path: badges/bugs.svg | |
| - name: Build and test with Maven | |
| run: mvn -V --color always -ntp test -Dtest=UpdateSupportedFormats#run | |
| - name: Commit updated files | |
| continue-on-error: true | |
| run: | | |
| git config --local user.email "action@github.com" | |
| 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 | |
| git add SUPPORTED-FORMATS.md | |
| git commit -m "Generate list of supported formats" || 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 |