Skip to content

Commit

Permalink
feat(cicd): publish allure report
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jun 7, 2024
1 parent af1b0a4 commit fdd0db5
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -59,6 +60,31 @@ jobs:
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }}
run: ./gradlew check

# Allure check
- name: Auth to Google Cloud
id: auth
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }}
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_SERVICE_ACCOUNT }}'

- uses: rlespinasse/github-slug-action@v4

- name: Publish allure report
uses: andrcuns/allure-publish-action@v2.6.0
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 && (github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '') }}
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm/
with:
storageType: gcs
resultsGlob: build/allure-results
bucket: internal-kestra-host
baseUrl: "https://internal.kestra.io"
prefix: ${{ format('{0}/{1}/{2}', github.repository, env.GITHUB_HEAD_REF_SLUG != '' && env.GITHUB_HEAD_REF_SLUG || github.ref_name, 'allure/java') }}
copyLatest: true
ignoreMissingResults: true

# Publish
- name: Publish package to Sonatype
if: github.ref == 'refs/heads/master'
Expand Down
23 changes: 23 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-params"
}

/**********************************************************************************************************************\
* Allure Reports
**********************************************************************************************************************/
dependencies {
testImplementation platform("io.qameta.allure:allure-bom:2.27.0")
testImplementation "io.qameta.allure:allure-junit5"
}

configurations {
agent {
canBeResolved = true
canBeConsumed = true
}
}

dependencies {
agent "org.aspectj:aspectjweaver:1.9.22.1"
}

test {
jvmArgs = [ "-javaagent:${configurations.agent.singleFile}" ]
}

/**********************************************************************************************************************\
* Publish
**********************************************************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/allure.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allure.results.directory=build/allure-results

0 comments on commit fdd0db5

Please sign in to comment.