Update README with all new features #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| permissions: | |
| contents: write | |
| checks: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build and test with coverage | |
| run: mvn verify -B | |
| - name: Generate JaCoCo badge | |
| id: jacoco | |
| uses: cicirello/jacoco-badge-generator@v2 | |
| with: | |
| jacoco-csv-file: target/site/jacoco/jacoco.csv | |
| badges-directory: .github/badges | |
| generate-coverage-badge: true | |
| coverage-badge-filename: jacoco.svg | |
| generate-branches-badge: true | |
| branches-badge-filename: branches.svg | |
| - name: Log coverage percentage | |
| run: | | |
| echo "Coverage: ${{ steps.jacoco.outputs.coverage }}" | |
| echo "Branches: ${{ steps.jacoco.outputs.branches }}" | |
| - name: Commit badge | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add .github/badges/ | |
| if git diff --cached --quiet; then | |
| echo "No badge changes to commit" | |
| else | |
| git commit -m "Update coverage badges [skip ci]" | |
| git push | |
| fi | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: target/site/jacoco/ | |
| retention-days: 14 | |
| - name: Package | |
| run: mvn package -DskipTests -B | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: javaducker-jar | |
| path: target/javaducker-1.0.0.jar | |
| retention-days: 7 |