Skip to content

add gh actions

add gh actions #18

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: Check license
env:
# required to run tests because the whole build.gradle seems to be evaluated, even if the jib task is not executed
# so the GITHUB_TOKEN var must be resolved
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew license
- name: Build and run tests
env:
# required to run tests because the whole build.gradle seems to be evaluated, even if the jib task is not executed
# so the GITHUB_TOKEN var must be resolved
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew test
# - name: Add coverage to PR
# id: jacoco
# uses: madrapps/[email protected]
# with:
# paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
# token: ${{ secrets.GITHUB_TOKEN }}
# min-coverage-overall: 40
# min-coverage-changed-files: 60
#
# - name: Setup .NET Core # Required to execute ReportGenerator
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 6.x
# dotnet-quality: 'ga'
#
# - name: ReportGenerator
# uses: danielpalme/[email protected]
# with:
# reports: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
# targetdir: coveragereport