fix: anonymise LICENSE copyright line #3
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install package + dev deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run pytest suite | |
| run: pytest tests/ -v | |
| - name: Boot server + verify endpoints | |
| run: | | |
| PYTHONPATH=src python -m pagewright examples/sample-book --port 5599 & | |
| SERVER_PID=$! | |
| sleep 3 | |
| curl -sf http://127.0.0.1:5599/api/health > /dev/null | |
| curl -sf http://127.0.0.1:5599/api/tree > /dev/null | |
| curl -sf "http://127.0.0.1:5599/api/file?path=01_introduction.md" > /dev/null | |
| curl -sf "http://127.0.0.1:5599/api/preview?path=01_introduction.md&mode=continuous" > /dev/null | |
| curl -sf "http://127.0.0.1:5599/api/preview?path=01_introduction.md&mode=paged" > /dev/null | |
| kill $SERVER_PID | |
| echo "OK: all endpoints respond 200" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - run: pip install ruff | |
| - run: ruff check src/ tests/ | |
| - run: ruff format --check src/ tests/ |