Merge pull request #169 from secvisogram/dependabot/gradle/com.github… #673
Workflow file for this run
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: Validate and Test | |
on: | |
push: | |
branches-ignore: | |
- gh-pages | |
jobs: | |
gradle: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
with: | |
gradle-version: 8.2.1 | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Execute Gradle build | |
run: ./gradlew clean build jacocoTestReport | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() # clause guarantees that this action always runs, even if earlier steps (e.g., the unit test step) in your workflow fail. | |
with: | |
files: "build/test-results/**/*.xml" | |
- name: Add coverage to PR | |
id: jacoco | |
uses: madrapps/[email protected] # requires at least two pushes to a PR, see https://github.com/Madrapps/jacoco-report/issues/13 | |
with: | |
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 40 | |
min-coverage-changed-files: 60 | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: code-coverage-report | |
path: build/reports/jacoco/** | |
lint-markdown: | |
name: Lint all markdown files in project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Lint markdowns | |
uses: nosborn/[email protected] | |
with: | |
files: '**/*.md' | |
checkstyle: | |
runs-on: ubuntu-latest | |
name: Run CheckStyle | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Run CheckStyle | |
uses: nikitasavinov/checkstyle-action@master | |
with: | |
checkstyle_config: checkstyle.xml | |
level: error | |
fail_on_error: true | |
reporter: 'github-check' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |