Skip to content

Commit

Permalink
feat(cicd): publish jacoco report
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jun 10, 2024
1 parent 65a78c1 commit 4d75deb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ jobs:
copyLatest: true
ignoreMissingResults: true

# Jacoco
- name: 'Set up Cloud SDK'
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }}
uses: 'google-github-actions/setup-gcloud@v2'

- name: 'Copy jacoco files'
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }}
run: |
gsutil -m rsync -d -r build/reports/jacoco/test/ gs://internal-kestra-host/${{ format('{0}/{1}/{2}', github.repository, env.GITHUB_HEAD_REF_SLUG != '' && env.GITHUB_HEAD_REF_SLUG || github.ref_name, 'jacoco') }}
# Publish
- name: Publish package to Sonatype
if: github.ref == 'refs/heads/master'
Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java-library'
id "idea"
id 'jacoco'
id "com.adarshr.test-logger" version "4.0.0"
id "com.github.johnrengelman.shadow" version "8.1.1"
id 'ru.vyarus.java-lib' version '3.0.0'
Expand Down Expand Up @@ -112,6 +113,17 @@ test {
jvmArgs = [ "-javaagent:${configurations.agent.singleFile}" ]
}

/**********************************************************************************************************************\
* Jacoco
**********************************************************************************************************************/
test {
finalizedBy jacocoTestReport
}

jacocoTestReport {
dependsOn test
}

/**********************************************************************************************************************\
* Publish
**********************************************************************************************************************/
Expand Down

0 comments on commit 4d75deb

Please sign in to comment.