docs(final presi): added actual image of calendar #664
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: Gradle Package | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| server-id: github | |
| settings-path: ${{ github.workspace }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| build-scan-publish: true | |
| build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
| build-scan-terms-of-use-agree: "yes" | |
| validate-wrappers: true | |
| - name: Build and test with Gradle | |
| run: ./gradlew clean build test jacocoTestReport | |
| - name: Install xmllint | |
| run: sudo apt-get update && sudo apt-get install -y libxml2-utils | |
| - name: Check coverage percentage | |
| id: coverage | |
| run: | | |
| THRESHOLD=75.0 # Set your desired minimum coverage percentage | |
| COVERAGE=$(xmllint --xpath "string(//report/counter[@type='LINE']/@covered)" build/reports/jacoco/test/jacocoTestReport.xml) | |
| MISSED=$(xmllint --xpath "string(//report/counter[@type='LINE']/@missed)" build/reports/jacoco/test/jacocoTestReport.xml) | |
| TOTAL=$((COVERAGE + MISSED)) | |
| PERCENTAGE=$(awk "BEGIN {printf \"%.2f\", ($COVERAGE / $TOTAL) * 100}") | |
| if (( $(echo "$PERCENTAGE < $THRESHOLD" | bc -l) )); then | |
| echo "::error title=Coverage::Your coverage is only $PERCENTAGE and should be improved" | |
| echo "**Test Coverage:** $PERCENTAGE%" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "**Test Coverage:** $PERCENTAGE%" >> $GITHUB_STEP_SUMMARY | |
| - name: Login to Docker | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker Image | |
| run: | | |
| export IMAGE_NAME=`echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'`:latest | |
| docker build -t "ghcr.io/$IMAGE_NAME" . | |
| docker push "ghcr.io/$IMAGE_NAME" | |
| dependency-submission: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| server-id: github | |
| settings-path: ${{ github.workspace }} | |
| - name: Generate and submit dependency graph | |
| uses: gradle/actions/dependency-submission@v4 |