PostgreSQL Function and Procedure Implementation #29
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: write | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| env: | |
| PYTHON_VERSION: "3.14" | |
| PIP_CACHE_DIR: /home/runner/.cache/pip | |
| UV_CACHE_DIR: /home/runner/.cache/uv | |
| WHEEL_CACHE_DIR: /home/runner/.cache/wheels | |
| PIP_FIND_LINKS: /home/runner/.cache/wheels | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ env.PYTHON_VERSION }}" | |
| - name: Install wx build deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential pkg-config gettext \ | |
| libgtk-3-dev libglib2.0-dev \ | |
| libjpeg-dev libpng-dev libtiff-dev libtiff6 \ | |
| libnotify-dev libsm-dev \ | |
| libsdl2-dev \ | |
| libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
| libglu1-mesa-dev freeglut3-dev \ | |
| libx11-dev libxext-dev libxinerama-dev libxi-dev libxrandr-dev \ | |
| libxss-dev libxtst-dev xvfb | |
| if ! sudo apt-get install -y libwebkit2gtk-4.0-dev; then | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev | |
| fi | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.PIP_CACHE_DIR }} | |
| key: pip-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('**/uv.lock', '**/pyproject.toml') }} | |
| restore-keys: | | |
| pip-${{ runner.os }}-py${{ env.PYTHON_VERSION }}- | |
| - name: Cache wheelhouse | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.WHEEL_CACHE_DIR }} | |
| key: wheel-${{ runner.os }}-py${{ env.PYTHON_VERSION }}-${{ hashFiles('**/uv.lock', '**/pyproject.toml') }} | |
| restore-keys: | | |
| wheel-${{ runner.os }}-py${{ env.PYTHON_VERSION }}- | |
| - name: Initialize venv UV | |
| run: uv venv | |
| - name: Export requirements from uv.lock (include dev extra) | |
| run: uv export --format requirements-txt --locked --no-hashes --extra dev -o requirements.lock.txt | |
| - name: Populate wheelhouse from lock (build/download wheels) | |
| run: | | |
| mkdir -p "${WHEEL_CACHE_DIR}" | |
| python -m pip wheel -w "${WHEEL_CACHE_DIR}" -r requirements.lock.txt | |
| - name: Upgrade build tooling | |
| run: uv pip install -U pip setuptools wheel | |
| - name: Install dependencies | |
| run: uv sync --extra dev --find-links "${WHEEL_CACHE_DIR}" | |
| - name: Run tests | |
| run: | | |
| if [ "${{ github.ref }}" != "refs/heads/main" ]; then | |
| echo "Running branch tests (--all)" | |
| xvfb-run -a ./scripts/runtest.sh --all | |
| else | |
| echo "Running main tests (--update)" | |
| xvfb-run -a ./scripts/runtest.sh --update | |
| fi | |
| - name: Commit and push updated README | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@github.com" | |
| git add README.md | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore: update badges [skip ci]" | |
| git push | |
| fi |