Skip to content

Commit

Permalink
Merge pull request #58 from giulong/docs/badges
Browse files Browse the repository at this point in the history
Docs/badges
  • Loading branch information
giulong authored Dec 9, 2023
2 parents f85632f + 5327728 commit 28710d2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,3 @@ jobs:

- name: mvn install
run: ./mvnw -B install -DallTests -DskipSign -Dmaven.plugin.validation=BRIEF

- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: docs/jacoco/jacoco.csv
coverage-label: Coverage
branches-label: Branches
intervals: 95 87.5 75 67.5 60 0
fail-if-coverage-less-than: 0.9
fail-if-branches-less-than: 0.9

- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branches = ${{ steps.jacoco.outputs.branches }}"
25 changes: 24 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: [ "main" ]
types: [ closed ]

env:
DOCS_FOLDER: docs

jobs:
deploy:
if: github.event.pull_request.merged
Expand All @@ -15,7 +18,8 @@ jobs:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- id: install-secret-key
name: Install gpg secret key
Expand Down Expand Up @@ -55,6 +59,25 @@ jobs:
target-branch: main
target-directory: ${{ env.version }}

- name: Spectrum submodule package
run: ./mvnw -B package -DskipSign -Dmaven.plugin.validation=BRIEF -pl spectrum

- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: ${{ env.DOCS_FOLDER }}/jacoco/jacoco.csv
branches-label: Branches
badges-directory: ${{ env.DOCS_FOLDER }}/badges
intervals: 95 87.5 75 67.5 60 0
fail-if-coverage-less-than: 0.9
fail-if-branches-less-than: 0.9

- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branches = ${{ steps.jacoco.outputs.branches }}"
- name: Setup GitHub Pages
uses: actions/configure-pages@v3

Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [ "docs/**" ]

env:
DOCS_FOLDER: docs

jobs:
deploy:
name: Docs
Expand All @@ -26,13 +29,29 @@ jobs:
- name: Spectrum submodule package
run: ./mvnw -B package -DskipSign -Dmaven.plugin.validation=BRIEF -pl spectrum

- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: ${{ env.DOCS_FOLDER }}/jacoco/jacoco.csv
branches-label: Branches
badges-directory: ${{ env.DOCS_FOLDER }}/badges
intervals: 95 87.5 75 67.5 60 0
fail-if-coverage-less-than: 0.9
fail-if-branches-less-than: 0.9

- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branches = ${{ steps.jacoco.outputs.branches }}"
- name: Setup GitHub Pages
uses: actions/configure-pages@v3

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: docs/
source: ${{ env.DOCS_FOLDER }}/
destination: ./_site

- name: Upload GitHub Pages Artifact
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div align="center">

[![Build](https://github.com/giulong/spectrum/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/giulong/spectrum/actions?query=branch%3Adevelop)
[![coverage](.github/badges/jacoco.svg)](https://giulong.github.io/spectrum/jacoco/)
[![branches coverage](.github/badges/branches.svg)](https://giulong.github.io/spectrum/jacoco/)
[![coverage](https://giulong.github.io/spectrum/badges/jacoco.svg)](https://giulong.github.io/spectrum/jacoco/)
[![badge-jdk](https://img.shields.io/badge/jdk-17-blue.svg)](https://www.oracle.com/java/technologies/javase-downloads.html)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.giulong/spectrum.svg)](https://search.maven.org/search?q=g:io.github.giulong%20a:spectrum)

<br />
<img src="src/main/resources/images/spectrum-logo.png" alt="Spectrum logo">

<br/>
<br/>
<div>
<a href="https://giulong.github.io/spectrum/" target="_blank">Full Docs</a>
Expand Down

0 comments on commit 28710d2

Please sign in to comment.