Clarify README repository structure context #73
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: Popup previews | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Playwright | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install playwright | |
| playwright install --with-deps chromium | |
| - name: Start static server | |
| run: | | |
| python -m http.server 8000 --bind 127.0.0.1 > /tmp/http.log 2>&1 & | |
| echo $! > /tmp/http-server.pid | |
| - name: Wait for popup HTML | |
| run: | | |
| for i in {1..30}; do | |
| if curl -sSf http://127.0.0.1:8000/src/popup/index.html > /dev/null; then | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "Timed out waiting for static server" >&2 | |
| cat /tmp/http.log >&2 || true | |
| exit 1 | |
| - name: Capture popup previews | |
| run: | | |
| python scripts/capture_popup_preview.py --output ci-artifacts/popup-default.png | |
| - name: Upload previews | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: popup-preview | |
| path: ci-artifacts/ | |
| - name: Stop static server | |
| if: always() | |
| run: | | |
| if [ -f /tmp/http-server.pid ]; then | |
| kill $(cat /tmp/http-server.pid) || true | |
| fi | |
| rm -f /tmp/http-server.pid | |
| cat /tmp/http.log || true |