This repository demonstrates how to generate an Allure report using GitHub Actions. By leveraging GitHub Actions, you can automate the process of generating and publishing Allure reports for your projects.
To use this example repository and generate Allure reports for your own projects, follow these steps:
Fork this repository to your own GitHub account by clicking the "Fork" button at the top-right corner of the page. This will create a copy of the repository under your account.
Go to the "Actions" tab in your forked repository and click on the "I understand my workflows, go ahead and enable them" button to enable GitHub Actions for your repository. This will allow the automated execution of workflows defined in the repository.
To enable Allure report generation and publishing, you need to configure the following settings in your repository:
- Go to the "Settings" tab in your forked repository.
- Click on the "Secrets and variables" option in the left sidebar.
- Click on the "Actions", Select "Variables" from Actions secrets and variables page and then Click on the "New repository variable" button.
- In the "Name" field, enter
ALLURE_RESULTS_PATH
. - In the "Value" field, enter the desired path where Allure results will be saved during the workflow execution (e.g.,
allure-results
). - Click on the "Add variable" button to save the secret.
To publish the generated Allure report, you can leverage GitHub Pages. Follow these steps to configure GitHub Pages for your repository:
- Go to the "Settings" tab in your forked repository.
- Scroll down to the "GitHub Pages" section under "Code and automation"
- Under "Source" dropdown, select "Deploy from a branch".
- Under the "Branch" dropdown, select the branch that contains the Allure report artifacts (e.g.,
gh-pages
). - Click on the "Save" button.
- For more information, refer https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-from-a-branch
Once you have forked the repository, enabled GitHub Actions, and configured the necessary settings, you can run the workflow to generate the Allure report:
- Go to the "Actions" tab in your forked repository.
- Click on the workflow named "Allure Report Generation" on the left sidebar.
- Click on the "Run workflow" button.
- Select the branch on which you want to run the workflow (e.g.,
master
). - Click on the "Run workflow" button to start the execution.
The workflow will execute, generate the Allure report based on the provided configurations, and publish it using GitHub Pages. You can then access the published report by visiting the GitHub Pages URL of your repository. i.e, https://<your_github_username>.github.io/<your_github_repo>/
Sample report @ https://ashikkumar23.github.io/github-action-with-allure-report/
For more information on configuring and customizing the Allure report generation process, refer to the following resources:
Feel free to explore the repository's code and workflows to understand the implementation details of generating Allure reports using GitHub Actions.
If you have any questions or encounter any issues, please open an issue in this repository.
Happy testing and reporting! 🚀