feat: add backstop js test #34
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: Backstop test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| backstop-tests: | |
| name: Visual regression tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| npm install ci | |
| npx playwright install | |
| - name: Install xvfb | |
| run: sudo apt-get install -y xvfb pandoc | |
| - name: Build documentation | |
| run: | | |
| pip install -e .[doc] | |
| xvfb-run make -C doc html | |
| - name: Serve documentation | |
| run: npx http-server -u -p 8000 ./doc/_build/html & | |
| - name: check if server is up | |
| run: curl -I http://localhost:8000 || true | |
| - name: Run BackstopJS tests | |
| run: | | |
| npm run test | |
| - name: Upload Backstop report (if failed) | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backstop-report | |
| path: backstop_data/html_report | |