Skip to content

Commit

Permalink
use template example
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Mar 24, 2024
1 parent e3432b5 commit 130fc21
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,34 @@ jobs:
- name: Build with Maven
run: mvn -B clean install

- name: Generate JaCoCo Badge
- name: Generate Jacoco Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true

- name: setup git config
- name: Log coverage percentage
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branches = ${{ steps.jacoco.outputs.branches }}"
- name: commit
- name: Commit and push
if: ${{ github.event_name != 'pull_request' }}
run: |
# Stage the file, commit and push
git add .
git commit -m "coverage badge"
git push origin main
cd .github/badges
if [[ `git status --porcelain *.svg` ]]; then
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add *.svg
git commit -m "Autogenerated JaCoCo coverage badge" *.svg
git push
fi
- name: Upload Jacoco coverage report
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco/

- name: Codecov
uses: codecov/[email protected]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## openconext-crypt-java

![Coverage](.github/badges/jacoco.svg)
[![coverage](https://raw.githubusercontent.com/OpenConext/openconext-crypt-java/badges/jacoco.svg)](https://github.com/OpenConext/openconext-crypt-java/actions/workflows/build.yml) [![branches coverage](https://raw.githubusercontent.com/OpenConext/openconext-crypt-java/badges/branches.svg)](https://github.com/OpenConext/openconext-crypt-java/actions/workflows/actions.yml)
![coverage](.github/badges/jacoco.svg)
![branches coverage](.github/badges/branches.svg)

Create private / public keypair
```
Expand Down

0 comments on commit 130fc21

Please sign in to comment.