Allure Report with history per branch (type: docker
)
See examples:
Compatible with HTML Trend Report Action
permissions:
contents: write
steps:
- name: Checkout gh-pages
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages # branch name
path: gh-pages-dir # checkout path
- name: Allure Report Action
uses: mgrybyk/allure-report-branch-action@v1
if: always()
continue-on-error: true
id: self_test # used in comment to PR
with:
report_id: 'self-test'
gh_pages: 'gh-pages-dir'
report_dir: 'allure-results'
- name: Git Commit and Push Action
uses: mgrybyk/git-commit-pull-push-action@v1
if: always()
with:
repository: gh-pages-dir
branch: gh-pages
pull_args: --rebase -X ours
permissions:
# required by https://github.com/thollander/actions-comment-pull-request
pull-requests: write
steps:
# After publishing to gh-pages
- name: Comment PR with Allure Report link
if: ${{ always() && github.event_name == 'pull_request' && steps.self_test.outputs.report_url }}
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
with:
message: |
${{ steps.self_test.outputs.test_result_icon }} [Allure Report](${{ steps.self_test.outputs.report_url }}) | [History](${{ steps.self_test.outputs.report_history_url }})
comment_tag: allure_self_test
mode: recreate
Please see action.yml
Log ! [rejected] HEAD -> gh-pages (non-fast-forward)
Do not run your workflow concurrently per PR or branch!
# Allow only one job per PR or branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true # true to cancel jobs in progress, set to false otherwise
The allure-report-branch-action
is designed as a JavaScript action wrapped with docker
action because allure
requires java and is shipped with bunch of java files.
As far as docker
action runs in linux environments only, it's required to do some extra steps for users running Windows and MacOS workflows. See Types of actions for more details.
- option 1: using upload/download artifacts. See simple-elf/allure-report-action/issues/28#issuecomment-1139332329
- option 2: use JS version of this action (raise an issue and I'll publish it). In this case you'll have to install Java and download download allure-commandline yourself.
- docker-java-node for building Dockerimage with Java and NodeJS together
- thollander/actions-comment-pull-request for building Github Action that comments the linked PRs
- cleanup old reports