diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac28861c..701255a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5626d0a3..c7fa1717 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,9 @@ on: branches: [ "main" ] types: [ closed ] +env: + DOCS_FOLDER: docs + jobs: deploy: if: github.event.pull_request.merged @@ -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 @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b84763ac..03552b42 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,9 @@ on: push: branches: [ "docs/**" ] +env: + DOCS_FOLDER: docs + jobs: deploy: name: Docs @@ -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 diff --git a/README.md b/README.md index cc62752c..eb3707b1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@
[![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) @@ -10,6 +9,7 @@
Spectrum logo +

Full Docs