Update Snapshots #32
Workflow file for this run
This file contains hidden or 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: Update Snapshots | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| update-snapshots: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Ensure snapshot and report dirs are writable by container user | |
| run: | | |
| mkdir -p e2e/tests/screenshot-test.spec.js-snapshots | |
| mkdir -p e2e/playwright-report | |
| sudo chown -R 1000:1000 e2e/tests/screenshot-test.spec.js-snapshots | |
| sudo chown -R 1000:1000 e2e/playwright-report | |
| - name: Create Docker network | |
| run: docker network create sf-website-development || true | |
| - name: Run Playwright tests with snapshot update | |
| run: | | |
| docker compose -f docker-compose.yml -f docker-compose.e2e.yml run --name apostrophe-playwright-test --build \ | |
| --entrypoint "sh -c 'until wget -qO- http://apostrophe:3000/ > /dev/null; do echo Waiting for Apostrophe...; sleep 2; done && npm run test:e2e:update -c playwright.config.js'" \ | |
| playwright-test | |
| continue-on-error: false | |
| - name: Copy snapshots from Docker volume | |
| run: | | |
| docker cp $(docker ps -aqf "name=apostrophe-playwright-test"):/e2e/tests/screenshot-test.spec.js-snapshots ./website/e2e/tests/screenshot-test.spec.js-snapshots | |
| - name: Upload snapshots as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-snapshots | |
| path: website/e2e/tests/screenshot-test.spec.js-snapshots | |
| overwrite: true | |
| retention-days: 20 | |
| - name: Stop and remove all Docker Compose containers | |
| run: | | |
| docker compose -f docker-compose.yml -f docker-compose.e2e.yml down --volumes --remove-orphans | |
| - name: Remove Docker network | |
| run: docker network rm sf-website-development || true |