Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/badges #58

Merged
merged 3 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading