v2.1.2: pin video title to its source tab (fix multi-tab mismatch) #33
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 | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| python-unit: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup Python | |
| run: uv python install 3.11 | |
| - name: Install Python test dependencies | |
| # requirements.txt has SHA256 hashes, so pip enforces --require-hashes | |
| # for that install. pytest is a dev-only extra and goes separately. | |
| run: | | |
| uv venv --python 3.11 | |
| uv pip install -r video-downloader/docker/requirements.txt | |
| uv pip install pytest==9.0.3 | |
| - name: Run Python unit tests (api + worker) | |
| run: | | |
| uv run pytest -q \ | |
| video-downloader/docker/api/tests \ | |
| video-downloader/docker/worker/tests | |
| chrome-extension-unit: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: chrome-extension | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run unit tests | |
| run: npm test | |
| api-smoke: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: video-downloader/docker | |
| env: | |
| API_URL: http://localhost:52052 | |
| API_KEY: ci-test-api-key | |
| DB_PASSWORD: postgres_password | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create .env for Docker Compose | |
| run: | | |
| cat > .env <<'EOF' | |
| API_KEY=ci-test-api-key | |
| DB_PASSWORD=postgres_password | |
| LOG_LEVEL=INFO | |
| RATE_LIMIT_PER_MINUTE=0 | |
| SSRF_GUARD=false | |
| EOF | |
| - name: Build unified image locally (for compose to use instead of GHCR) | |
| run: docker compose -f docker-compose_not_synology.yml build api | |
| - name: Start API stack (db/redis/api) | |
| run: docker compose -f docker-compose_not_synology.yml up -d db redis api | |
| - name: Wait for API readiness | |
| run: | | |
| for i in {1..60}; do | |
| if curl -fsS -H "Authorization: Bearer $API_KEY" "$API_URL/api/health" >/dev/null; then | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| docker compose -f docker-compose_not_synology.yml ps | |
| docker compose -f docker-compose_not_synology.yml logs --no-color api | |
| exit 1 | |
| - name: Run API test script | |
| run: | | |
| chmod +x ./test-api.sh | |
| API_URL="$API_URL" API_KEY="$API_KEY" ./test-api.sh | |
| - name: Shutdown | |
| if: always() | |
| run: docker compose -f docker-compose_not_synology.yml down -v | |