Playwright Tests #15
This file contains 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 | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Grant execute permission for Gradlew | |
run: chmod +x ./gradlew | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build & Install Dependencies | |
run: ./gradlew build -x test | |
- name: Install Playwright | |
run: ./gradlew playwrightInstall | |
- name: Run tests | |
run: ./gradlew clean test | |
- name: Generate Allure Report | |
run: ./gradlew allureReport | |
- name: Upload Allure Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: allure-results | |
path: build/reports/allure-report/allureReport | |
retention-days: 20 | |
- name: Get Allure history | |
uses: actions/checkout@v4 | |
if: always() | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Allure Report action from marketplace | |
uses: simple-elf/allure-report-action@v1.9 | |
if: always() | |
with: | |
allure_results: build/allure-results | |
allure_history: gh-pages/allure-history | |
keep_reports: 20 | |
- name: Deploy report to Github Pages | |
if: always() | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
personal_token: ${{ secrets.PLAYWRIGHT_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: gh-pages/allure-history |