Playwright Tests #61
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: | |
permissions: | |
actions: write | |
packages: write | |
contents: read | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ github.sha }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.27" | |
enable-cache: true | |
cache-dependency-glob: "requirements**.txt" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
uv pip install --system -r requirements.txt | |
- name: Ensure browsers are installed | |
run: uv pip install --system playwright && python -m playwright install --with-deps | |
- name: Run your tests | |
env: | |
PARABANK_USERNAME: ${{ secrets.PARABANK_USERNAME }} | |
PARABANK_PASSWORD: ${{ secrets.PARABANK_PASSWORD }} | |
run: | | |
mkdir -p test-results | |
pytest --alluredir=allure-results --tracing=retain-on-failure | |
- name: Upload Playwright traces | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: playwright-traces | |
path: test-results/ | |
retention-days: 20 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: allure-results | |
path: allure-results | |
retention-days: 20 | |
- name: Get Allure history | |
uses: actions/[email protected] | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Allure Report action from marketplace | |
uses: simple-elf/[email protected] | |
if: always() | |
with: | |
allure_results: allure-results | |
allure_history: allure-history | |
keep_reports: 20 | |
- name: Deploy report to Github Pages | |
if: always() | |
uses: peaceiris/actions-gh-pages@v2 | |
env: | |
PERSONAL_TOKEN: ${{ secrets.PARA_BANK }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: allure-history |