Merge pull request #9 from bitfist/dependabot/gradle/com.fasterxml.ja… #45
This file contains 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: 'test' | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
# Setup | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'liberica' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-read-only: false | |
# Job | |
- name: Test | |
run: | | |
./gradlew test jacocoTestReport | |
- name: Generate JaCoCo Badge | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
generate-branches-badge: true | |
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv | |
- name: Update badges (if changed) | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name 'github_actions' | |
git config --global user.email '1898282+github-actions[bot]@users.noreply.github.com>' | |
git add -A | |
git commit -m "update coverage badge" | |
git push | |
fi | |
dependency-submission: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
# Setup | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'liberica' | |
# Job | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@v4 |