Skip to content

Playwright Tests

Playwright Tests #5

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 test
- name: Generate Allure Report
run: ./gradlew allureReport
- name: Upload Allure Results
uses: actions/upload-artifact@v4
with:
name: allure-results
path: build/allure-results
retention-days: 20
- name: Get Allure history
uses: actions/checkout@v4
if: always()
with:
ref: gh-pages
path: gh-pages
- name: Copy Allure history
if: always()
run: |
mkdir -p build/allure-results/history
cp -R gh-pages/allure-history/* build/allure-results/history || true
- 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