Add Github actions for CI #3
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: CI (uv) | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| pull_request: | |
| branches: ["*"] | |
| jobs: | |
| lint: | |
| name: Lint (ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup uv environment | |
| uses: ./.github/actions/setup-uv | |
| with: | |
| dependency-group: dev | |
| - name: Ruff format (check) | |
| run: uv run ruff format --check | |
| - name: Ruff check | |
| run: uv run ruff check --output-format=github | |
| test: | |
| name: Test (pytest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup uv environment | |
| uses: ./.github/actions/setup-uv | |
| with: | |
| dependency-group: test | |
| - name: Run pytest | |
| run: uv run pytest -q tests/ | |
| docs: | |
| name: Docs (Sphinx) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup uv environment | |
| uses: ./.github/actions/setup-uv | |
| with: | |
| dependency-group: docs | |
| - name: Build Sphinx HTML | |
| run: uv run sphinx-build -b html docs docs/_build/html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| publish-docs: | |
| name: Publish Docs | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: docs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |