feat: Add example python project #748
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: CI | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: read | |
jobs: | |
build-and-test-extension: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" # caching pip dependencies | |
- name: Verify Docker installation | |
run: | | |
docker --version | |
docker info | |
- name: Build Docker image | |
working-directory: ./projects/extension | |
run: make docker-build | |
- name: Run Docker container | |
working-directory: ./projects/extension | |
run: make docker-run | |
- name: Build | |
run: docker exec pgai-ext make build | |
- name: Lint SQL and Python | |
run: docker exec pgai-ext make lint | |
- name: Check Python Formatting | |
run: docker exec pgai-ext make format-py | |
- name: Install extension | |
run: docker exec pgai-ext make install | |
- name: Run test server | |
run: docker exec -d pgai-ext make test-server | |
- name: Run tests | |
run: docker exec pgai-ext make test | |
- name: Stop and remove Docker container | |
working-directory: ./projects/extension | |
run: | | |
make docker-stop | |
make docker-rm | |
build-and-test-pgai: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.29" | |
enable-cache: true | |
cache-dependency-glob: "./projects/pgai/uv.lock" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "./projects/pgai/.python-version" | |
- name: Install dependencies | |
working-directory: ./projects/pgai | |
run: uv sync | |
- name: Lint | |
working-directory: ./projects/pgai | |
run: make lint | |
- name: Check Typing | |
working-directory: ./projects/pgai | |
run: make type-check | |
- name: Check Formatting | |
working-directory: ./projects/pgai | |
run: make format | |
- name: Run Tests | |
working-directory: ./projects/pgai | |
run: make test | |
- name: Build the pgai distributable and check artifacts | |
working-directory: ./projects/pgai | |
run: make build |