Skip to content

feat: First steps to replace sql normalization with rusts #67

feat: First steps to replace sql normalization with rusts

feat: First steps to replace sql normalization with rusts #67

Workflow file for this run

name: SQLGuard CI/CD
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
jobs:
test-sqlguard:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.13"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Rust
run: |
rustup toolchain install --profile minimal --no-self-update
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
uv sync --dev
- name: Run tests with uv
run: |
export UV_LINK_MODE=copy
uv run pytest tests
test-tox-sqlguard:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: |
rustup toolchain install --profile minimal --no-self-update
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install Tox & Tox UV
run: |
uv tool install tox --with tox-uv
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run Tox suite
run: tox run -- tests
build-sqlguard-sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path rust/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sqlguard-sdist
path: dist
build-sqlguard-wheels:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- runner: ubuntu-24.04
target: x86_64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path rust/Cargo.toml
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-sqlguard-${{ matrix.platform.target }}
path: dist
publish-sqlguard:
needs:
- build-sqlguard-sdist
- build-sqlguard-wheels
strategy:
matrix:
platform:
- runner: ubuntu-24.04
target: x86_64
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
# Needed for fetching the code
contents: read
steps:
- name: Download Artifacts Sdist
uses: actions/download-artifact@v4
with:
name: sqlguard-sdist
path: dist
- name: Download Artifacts Wheels
uses: actions/download-artifact@v4
with:
name: wheels-sqlguard-${{ matrix.platform.target }}
path: dist
- name: Publish package distributions to TEST PyPI
if: "!startsWith(github.ref, 'refs/tags/')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
# verbose: true
- name: Publish package distributions to PyPI Official (Tags Only)
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1