Skip to content

Commit

Permalink
[#706] DOC: Add GitHub badge with test count to README
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Jan 27, 2023
1 parent 27cfa93 commit ec80bdb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [ push, pull_request ]
permissions:
checks: write
pull-requests: write

jobs:
build-java-8-plus:
strategy:
Expand Down Expand Up @@ -40,23 +40,58 @@ jobs:

- name: Build
run: ./gradlew build --no-daemon

- name: Publish Test Results (Linux)
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
with:
junit_files: |
build/test-results/test/**/*.xml
picocli-*/build/test-results/test/**/*.xml
- name: Publish Test Results (Win/Mac)
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: ${{ always() && (matrix.os == 'macos-latest' || matrix.os == 'windows-latest') }}
with:
junit_files: |
build/test-results/test/**/*.xml
picocli-*/build/test-results/test/**/*.xml
- name: Set badge color
shell: bash
run: |
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
success)
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
;;
failure)
echo "BADGE_COLOR=800000" >> $GITHUB_ENV
;;
neutral)
echo "BADGE_COLOR=696969" >> $GITHUB_ENV
;;
esac
- name: Create badge
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1
with:
label: Tests
status: '${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}'
color: ${{ env.BADGE_COLOR }}
path: badge.svg

- name: Upload badge to Gist
# Upload only for master branch
if: >
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'master' ||
github.event_name != 'workflow_run' && github.ref == 'refs/heads/master'
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
with:
token: ${{ secrets.GIST_TOKEN }}
gistURL: https://gist.githubusercontent.com/remkop/picocli
file: badge.svg


build-java-6-7:
strategy:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![GitHub Release](https://img.shields.io/github/release/remkop/picocli.svg)](https://github.com/remkop/picocli/releases)
[![Maven Central](https://img.shields.io/maven-central/v/info.picocli/picocli.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22info.picocli%22%20AND%20a:%22picocli%22)
[![GitHub Actions Build Status](https://github.com/remkop/picocli/actions/workflows/ci.yml/badge.svg)](https://github.com/remkop/picocli/actions/workflows/ci.yml)
[![Test Results](https://gist.githubusercontent.com/{user}/{id}/raw/badge.svg)](https://github.com/remkop/picocli/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/remkop/picocli/branch/master/graph/badge.svg)](https://codecov.io/gh/remkop/picocli)
[![Follow @remkopopma](https://img.shields.io/twitter/follow/remkopopma.svg?style=social)](https://twitter.com/intent/follow?screen_name=remkopopma)
[![Follow @picocli](https://img.shields.io/twitter/follow/picocli.svg?style=social)](https://twitter.com/intent/follow?screen_name=picocli)
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96).
* [#1910][#1917] DOC: Fix broken link to Zero Bug Commitment. Thanks to [Jiehong](https://github.com/Jiehong) for raising this and thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
* [#1915] DOC: Improve default provider examples. Thanks to [David](https://github.com/DavidTheExplorer) for raising this.
* [#1918][#1920] DOC: Removed unused Travis CI badge and associated broken link from README. Thanks to [Andreas Deininger](https://github.com/deining) for raising this and the pull request.
* [#706] DOC: Add GitHub badge with test count to README.
* [#1939] BUILD: Fix `picocli-annotation-processing-tests` failures on Java 16+: rewrite tests to avoid Google `compiler-test` API that internally uses `com.sun.tools.javac.util.Context`.
* [#1887] DEP: Bump biz.aQute.bnd.gradle from 6.3.1 to 6.4.0
* [#1865] DEP: Bump ivy from 2.5.0 to 2.5.1
Expand Down

0 comments on commit ec80bdb

Please sign in to comment.