Skip to content

Commit

Permalink
ci: integrate Allure report into check and publish workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Aug 21, 2024
1 parent e87e92e commit 1fe4b09
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ jobs:
./gradlew spotlessCheck
check:
uses: wetransform/gha-workflows/.github/workflows/gradle-library-check.yml@feat/multi-module-improvements
uses: wetransform/gha-workflows/.github/workflows/gradle-library.yml@06a242e21c2f8e81407d629a67b747eea7c91706 # v2.4.0
with:
java-version: 17
multi-module: true
skip-scan: true
gradle-tasks: '--continue clean check' # perform all tasks even if tests of one project fail
build-tasks: '--continue clean check :allure:allureAggregateReport' # perform all tasks even if tests of one project fail
upload-artifact-path: allure/build/reports/allure-report/allureAggregateReport
upload-artifact-name: Allure test report
notify-failure: false
secrets:
WETF_ARTIFACTORY_USER: ${{ secrets.WETF_ARTIFACTORY_USER }}
WETF_ARTIFACTORY_PASSWORD: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }}
47 changes: 45 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,56 @@ concurrency:

jobs:
publish:
uses: wetransform/gha-workflows/.github/workflows/gradle-library-publish.yml@feat/multi-module-improvements
# Only on main repository (no publishing on forks)
if: github.repository_owner == 'halestudio'

uses: wetransform/gha-workflows/.github/workflows/gradle-library-publish.yml@master # TODO use release
with:
java-version: 17
multi-module: true
skip-scan: true
build-tasks: 'clean spotlessCheck check'
build-tasks: '--continue clean spotlessCheck check :allure:allureAggreggateResults'
upload-artifact-path: allure/build/allure-results
upload-artifact-name: allure-results
secrets:
WETF_ARTIFACTORY_USER: ${{ secrets.WETF_ARTIFACTORY_USER }}
WETF_ARTIFACTORY_PASSWORD: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }}
SLACK_NOTIFICATIONS_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}

allure:
# https://allurereport.org/docs/integrations-github/
runs-on: ubuntu-latest
if: always() // even if tests fail
needs: publish
permissions:
contents: write

steps:
- name: Download artifact from build
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: allure-results
path: allure-results

- name: Load test report history
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Build test report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: allure-results

- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
publish_branch: gh-pages
publish_dir: allure-history
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Only on main repository (don't release on forks)
if: github.repository_owner == 'halestudio'

uses: wetransform/gha-workflows/.github/workflows/gradle-library-publish.yml@feat/multi-module-improvements
uses: wetransform/gha-workflows/.github/workflows/gradle-library-publish.yml@06a242e21c2f8e81407d629a67b747eea7c91706 # v2.4.0
with:
java-version: 17
multi-module: true
Expand Down
2 changes: 1 addition & 1 deletion .wetf-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ presets: []

# List of custom required checks
required_checks:
- check / check / run
- check / run
- require-challenge
- spotless

0 comments on commit 1fe4b09

Please sign in to comment.