Skip to content

bruk testbranch som base #28

bruk testbranch som base

bruk testbranch som base #28

name: Update Playwright screenshots
on:
push:
branches: [playwright-regresiion-test] # TODO: endre tilbake til master før merge til master
pull_request:
branches: [playwright-regresiion-test] # TODO: endre tilbake til master før merge til master
jobs:
update-screenshots:
name: Update screenshots
runs-on: ubuntu-latest-16-cores
permissions:
id-token: "write"
contents: write
pull-requests: write
steps:
- name: Print Runner Information
run: |
echo "Runner name: ${{ runner.name }}"
echo "Runner OS: ${{ runner.os }}"
echo "Runner architecture: ${{ runner.arch }}"
echo "Runner group: ${{ runner.group }}"
echo "Total runner memory (approx): $(grep MemTotal /proc/meminfo)"
echo "CPU information:"
lscpu
- name: Get branch of PR
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- run: npm run build-storybook
- name: Run Playwright update screenshots
run: docker run --rm -v $(pwd):/workspace -w /workspace --ipc=host mcr.microsoft.com/playwright:v1.49.1-noble /bin/bash -c "CI=true npx playwright test --update-snapshots"
- name: Commit and push updated screenshots
if: always()
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update Playwright screenshots"
- name: Comment success
uses: thollander/actions-comment-pull-request@v3
with:
message: |
### 🎉 Successfully updated and committed Playwright snapshots! 🎉