feat: migrate project from GitHub Enterprise (#2) #2
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: Run tests and code checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
# Required by mikepenz/action-junit-report | |
checks: write | |
# Required by actions/checkout | |
contents: read | |
# Required by mi-kas/kover-report | |
pull-requests: write | |
jobs: | |
test: | |
name: Test | |
runs-on: | |
- ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
cache: "gradle" | |
- name: Run test | |
run: ./gradlew check --no-daemon | |
- name: Publish test reports | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: | | |
**/build/test-results/test/TEST-*.xml | |
- name: Create coverage report | |
if: ${{ github.event.pull_request }} | |
run: ./gradlew koverXmlReport | |
- name: Post coverage report as comment | |
if: ${{ github.event.pull_request }} | |
uses: mi-kas/kover-report@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
path: | | |
${{ github.workspace }}/build/reports/kover/report.xml | |
title: Code Coverage | |
update-comment: true | |
min-coverage-overall: 80 | |
min-coverage-changed-files: 80 | |
coverage-counter-type: LINE |