Skip to content

Merge pull request #97 from code4romania/bugfix/make-matrix-publicly-… #70

Merge pull request #97 from code4romania/bugfix/make-matrix-publicly-…

Merge pull request #97 from code4romania/bugfix/make-matrix-publicly-… #70

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
setup:
name: Get Vercel preview url
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel preview deployment to be ready
uses: patrickedqvist/wait-for-vercel-preview@v1.3.1
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 300
test:
needs: setup
name: Run Playwright tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install dependencies
working-directory: ./client
run: yarn
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.OS }}-pw-browsers-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-pw-browsers-
- name: Install Playwright Browsers
working-directory: ./client
run: yarn playwright install --with-deps
- name: Run Playwright tests
working-directory: ./client
run: yarn playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.setup.outputs.preview_url }}
TEST_USER_EMAIL: platica.ciprian+user@gmail.com
TEST_USER_PASSWORD: Hello12345
TEST_MENTOR_EMAIL: platica.ciprian+mentor@gmail.com
TEST_MENTOR_PASSWORD: Hello12345
TEST_ADMIN_EMAIL: platica.ciprian+admin@gmail.com
TEST_ADMIN_PASSWORD: Hello12345
- name: Upload Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: client/playwright-report/
retention-days: 30
deploy:
needs: test
name: Deploy report to GitHub pages
if: always()
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: playwright-report
- name: Upload artifact to pages
uses: actions/upload-pages-artifact@v2
with:
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2