Skip to content

Commit

Permalink
Use new quality monitor action in workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Dec 20, 2023
1 parent 97aece4 commit a6d29f6
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 156 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Generate Codecov coverage report'

on:
push:
branches:
- master
- main
pull_request:

jobs:
coverage:

runs-on: ubuntu-latest
name: Create coverage report and upload results to Codecov on Ubuntu

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/[email protected]
with:
maven-version: 3.9.5
- name: Build with Maven
run: mvn -V --color always -ntp clean verify
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: 'target/site/jacoco/jacoco.xml'
token: ${{secrets.CODECOV_TOKEN}}
36 changes: 36 additions & 0 deletions .github/workflows/quality-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Quality Monitor PR'

on:
pull_request:

jobs:
build:

runs-on: [ubuntu-latest]
name: Build, test and monitor quality on Ubuntu

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/[email protected]
with:
maven-version: 3.9.5
- name: Build with Maven
env:
BROWSER: chrome-container
run: mvn -V --color always -ntp clean verify -Ppit | tee maven.log
- name: Extract pull request number
uses: jwalton/gh-find-current-pr@v1
id: pr
- name: Run Quality Monitor
uses: uhafner/quality-monitor@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ steps.pr.outputs.number }}
156 changes: 0 additions & 156 deletions .github/workflows/reporting.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/update-badges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: 'Update project badges'

on:
push:
branches:
- main

jobs:
coverage:

runs-on: [ubuntu-latest]
name: Update project quality badges on Ubuntu

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/[email protected]
with:
maven-version: 3.9.5
- name: Build and test with Maven
run: mvn -V --color always -ntp clean verify --file pom.xml '-Dgpg.skip' '-Ppit' | 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 warnings
uses: emibcn/[email protected]
with:
label: 'Warnings'
status: ${{ steps.metrics.outputs.warnings }}
color: 'orange'
path: badges/warnings.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
- name: Push updated badges to GitHub repository
uses: ad-m/github-push-action@master
if: ${{ success() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

0 comments on commit a6d29f6

Please sign in to comment.