Skip to content

Tests E2E

Tests E2E #921

Workflow file for this run

name: Tests E2E
on: deployment_status
jobs:
tests:
name: Tests E2E
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
steps:
- name: πŸš€ Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: 🎯 Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: πŸ—οΈ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: πŸ“¦ Setup pnpm - Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
- name: πŸ“¦ Setup pnpm - Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: πŸ“¦ Setup pnpm - Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ“¦ Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: πŸ“¦ Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: 🌐 Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps
- name: 🎭 Run Playwright tests
run: pnpm test:e2e
env:
BASE_URL: ${{ github.event.deployment_status.target_url }}
- name: πŸ“Š Upload Playwright Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30