fix: improve previewUrl resolution error messages and add tests #52
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: CI | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run unit tests | |
| run: pnpm test | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install ffmpeg | |
| run: sudo apt-get install -y ffmpeg | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-chromium-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: playwright-chromium- | |
| - name: Install Playwright Chromium | |
| run: pnpm --filter @git-glimpse/core exec playwright install chromium --with-deps | |
| - name: Start example app | |
| run: node examples/simple-app/server.js & | |
| - name: Wait for app to be ready | |
| run: | | |
| for i in $(seq 1 15); do | |
| curl -sf http://localhost:3000 && echo "App ready" && exit 0 | |
| echo "Waiting... ($i)" | |
| sleep 1 | |
| done | |
| echo "App did not become ready" && exit 1 | |
| - name: Run integration tests | |
| run: pnpm test:integration |