configuracao pipeline #2
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: Run Tests and Generate Allure Report | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| - name: Install dependencies | |
| run: | | |
| mvn clean install | |
| - name: Run tests and generate Allure results | |
| run: | | |
| mvn test -Dsurefire.rerunFailingTestsCount=2 -Dallure.results.directory=allure-results | |
| - name: Generate Allure Report | |
| run: | | |
| mvn allure:report | |
| - name: Upload Allure report as artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: allure-report | |
| path: target/site/allure-maven-plugin | |
| - name: Deploy Allure report to GitHub Pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./target/site/allure-maven-plugin |