diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51a01246c..31a2f9607 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,18 +22,10 @@ jobs: java-version: '17' cache: 'maven' - # from https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - name: Build and Test with Maven timeout-minutes: 15 run: ./mvnw -B test - - name: Generate JaCoCo Badge - uses: cicirello/jacoco-badge-generator@v2 - with: - generate-branches-badge: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Commit and push the badge (if it changed) uses: EndBug/add-and-commit@v7 with: diff --git a/.github/workflows/update-jacoco-badge.yml b/.github/workflows/update-jacoco-badge.yml new file mode 100644 index 000000000..28999a232 --- /dev/null +++ b/.github/workflows/update-jacoco-badge.yml @@ -0,0 +1,22 @@ +name: Update Jacoco Coverage Badge + +on: + push: + branches: + - '*' # matches every branch that doesn't contain a '/' + - '*/*' # matches every branch containing a single '/' + - '**' # matches every branch + - '!master' # excludes master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Build and Test with Maven + timeout-minutes: 15 + run: ./mvnw -B test + + - name: Generate JaCoCo Badge + uses: cicirello/jacoco-badge-generator@v2 + with: + generate-branches-badge: true \ No newline at end of file diff --git a/README.md b/README.md index 717bcf078..c264db12c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Robot Overlord ![workflow](https://github.com/MarginallyClever/Robot-Overlord-App/actions/workflows/main.yml/badge.svg) +![coverage](https://github.com/MarginallyClever/Robot-Overlord-App/actions/workflows/main.yml/jacoco.svg) [![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://marginallyclever.github.io/Robot-Overlord-App/) + # Robot Overlord # ![Preview image](Screenshot_2023-12-23_120520.png)