Publish allure reports to ghpages #169
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: Playwright Tests | |
| # Trigger the workflow on every push to any branch | |
| on: | |
| push: | |
| branches: | |
| - '**' # Run on pushes to main | |
| pull_request: | |
| branches: | |
| - '**' # Run on every pull request for any branch | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Check out the repository code | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| # Step 2: Set up JDK 17 (adjust if you're using a different version) | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| # Step 3: Install Maven 3.9.9 | |
| - name: Setup Maven Action | |
| uses: s4u/[email protected] | |
| with: | |
| checkout-fetch-depth: 0 | |
| java-version: 17 | |
| java-distribution: temurin | |
| maven-version: 3.9.9 | |
| # Step 4: Verify Maven installation | |
| - name: Verify Maven version | |
| run: mvn --version | |
| # Step 5: Cache Maven dependencies | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven | |
| - name: Install Playwright dependencies | |
| run: npx playwright install-deps | |
| # Step 6: Run Maven to execute Playwright tests | |
| - name: Run Playwright Tests | |
| run: mvn verify | |
| # Step 7: Upload Allure Report directory as artifact | |
| - name: Upload Allure Report directory | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-report | |
| path: target/site/allure-maven-plugin/ | |
| reporting: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| # Step 1: Download Allure Report directory artifact | |
| - name: Download Allure Report directory | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: allure-report | |
| # Step 3: Deploy Allure report to GitHub Pages | |
| - name: Deploy Allure Report to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: target/site/allure-maven-plugin |