ci(test): integrate Allure reporting with Maven #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - feature/** | |
| pull_request: | |
| branches: | |
| - main | |
| - feature/** | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'maven' | |
| - name: Build and Run Tests with Allure | |
| run: mvn clean verify -DtrimStackTrace=false -Dorg.slf4j.simpleLogger.defaultLogLevel=debug | |
| - name: Generate Surefire and Allure Reports | |
| run: mvn site allure:report | |
| - name: Upload Test Reports (Surefire + Allure) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports | |
| path: | | |
| target/surefire-reports/ | |
| target/failsafe-reports/ | |
| target/site/ | |
| target/allure-report/ | |
| retention-days: 90 | |
| - name: Publish Allure Report | |
| if: always() | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: target/allure-report/ | |
| deploy-allure: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Deploy Allure Report to GitHub Pages | |
| uses: actions/deploy-pages@v4 |