Skip to content

Commit

Permalink
Added jacoco to build. Resolves #58
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Jun 22, 2021
1 parent c18daab commit 6e3cd58
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
61 changes: 44 additions & 17 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,49 @@ on:

jobs:
build:

runs-on: ubuntu-18.04
name: Build
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
if: startsWith(github.event.head_commit.message, 'Releasing version') != true

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
env:
GITHUB_USERNAME: jruaux
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }}
restore-keys: |
${{ runner.os }}-gradlew-
- name: Build with Gradle
run: ./gradlew build aggregateJacocoReport -S
env:
GITHUB_USERNAME: jruaux
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Show Reports
uses: actions/upload-artifact@v1
if: failure()
with:
name: reports-${{ runner.os }}
path: build/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ config {
enabled = false
}
}

}

allprojects {
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ buildscript {
classpath "org.kordamp.gradle:kordamp-parentbuild:$kordampBuildVersion"
classpath "org.kordamp.gradle:java-project-gradle-plugin:$kordampPluginVersion"
classpath "org.kordamp.gradle:guide-gradle-plugin:$kordampPluginVersion"
classpath "org.kordamp.gradle:jacoco-gradle-plugin:$kordampPluginVersion"
classpath "io.github.gradle-nexus:publish-plugin:$nexusPluginVersion"
classpath "org.jreleaser:jreleaser-gradle-plugin:$jreleaserPluginVersion"
classpath "io.freefair.gradle:lombok-plugin:6.0.0-m2"
Expand All @@ -30,7 +29,6 @@ projects {
}
path(':') {
id 'org.kordamp.gradle.java-project'
id 'org.kordamp.gradle.jacoco'
id 'org.jreleaser'
id 'io.github.gradle-nexus.publish-plugin'
}
Expand Down

0 comments on commit 6e3cd58

Please sign in to comment.