BO01 - Create a layout for the BackOffice #324
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: Playwright Tests | |
on: | |
pull_request_target: | |
branches: [main] | |
permissions: | |
pull-requests: write | |
jobs: | |
authorize: | |
environment: | |
${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
test: | |
needs: authorize | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
env: | |
PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
PUBLIC_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | |
steps: | |
- uses: actions/github-script@v7 | |
id: pr | |
with: | |
script: | | |
const { data: pullRequest } = await github.rest.pulls.get({ | |
...context.repo, | |
pull_number: context.payload.pull_request.number, | |
}); | |
return pullRequest | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8.14.3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "pnpm" | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright Browsers | |
run: pnpm exec playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: pnpm exec playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: Build | |
run: pnpm run build | |
- name: Run Playwright tests | |
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results.json pnpm exec playwright test --reporter json | |
- uses: daun/playwright-report-summary@v3 | |
if: always() | |
with: | |
report-file: results.json | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |