Update README.md #12
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 | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| workflow_dispatch: | |
| # Cancel superseded runs on the same ref to save CI minutes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test (headless Chrome) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "21" | |
| cache: maven | |
| - name: Set up Chrome | |
| uses: browser-actions/setup-chrome@v1 | |
| with: | |
| chrome-version: stable | |
| - name: Run tests (TestNG + Cucumber) | |
| run: mvn -B clean test -Dheadless=true | |
| - name: Generate Allure report | |
| if: always() | |
| run: mvn -B allure:report | |
| - name: Upload Allure results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-results | |
| path: target/allure-results | |
| if-no-files-found: ignore | |
| - name: Upload Allure HTML report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: allure-report | |
| path: target/site/allure-maven-plugin | |
| if-no-files-found: ignore | |
| - name: Upload Surefire reports & logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: surefire-and-logs | |
| path: | | |
| target/surefire-reports | |
| target/logs | |
| if-no-files-found: ignore | |
| # Publishes the latest Allure report (with execution history) to GitHub Pages. | |
| # Runs only on main, and even when tests fail, so the published report always | |
| # reflects the true state of the suite. | |
| publish-report: | |
| name: Publish Allure report to GitHub Pages | |
| needs: test | |
| if: always() && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "21" | |
| - name: Download Allure results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: allure-results | |
| path: allure-results | |
| - name: Restore previous report history | |
| uses: actions/checkout@v4 | |
| continue-on-error: true | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Carry over execution history | |
| run: | | |
| mkdir -p allure-results/history | |
| if [ -d gh-pages/history ]; then | |
| cp -r gh-pages/history/. allure-results/history/ | |
| fi | |
| - name: Generate Allure report | |
| run: | | |
| npm install -g allure-commandline --silent | |
| allure generate allure-results --clean -o allure-report | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: allure-report |