Tests E2E #135
Workflow file for this run
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: 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=$(npm 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 |