foreach tutorial refactor #17
This file contains 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: Run Unit Tests - CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Run tests | |
run: | | |
uv run pytest tests | |
- name: Build documentation | |
run: | | |
cd docs | |
uv run mkdocs build | |
- name: Upload documentation artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/site | |
# Deployment job | |
deploy_docs: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build_and_test | |
permissions: | |
id-token: write | |
pages: write | |
steps: | |
- name: Deploy Docs to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |