diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4702893..cb2bb82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -54,6 +55,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' diff --git a/build.gradle b/build.gradle index db69256..bbf40f2 100644 --- a/build.gradle +++ b/build.gradle @@ -90,6 +90,29 @@ dependencies { testImplementation "org.hamcrest:hamcrest-library:2.2" } +/**********************************************************************************************************************\ + * 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 **********************************************************************************************************************/ diff --git a/src/test/resources/allure.properties b/src/test/resources/allure.properties new file mode 100644 index 0000000..4873f6d --- /dev/null +++ b/src/test/resources/allure.properties @@ -0,0 +1 @@ +allure.results.directory=build/allure-results