Merge pull request #178 from QueryaHub/chore-upgrade-oxyjwt-0-7 #231
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 | |
| on: | |
| push: | |
| branches: [main, master, dev] | |
| pull_request: | |
| branches: [main, master, dev] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Sync (locked) dev environment | |
| run: uv sync --frozen --extra dev | |
| - name: Ruff (check + format) | |
| run: | | |
| uv run ruff check oxyroute tests examples | |
| uv run ruff format --check oxyroute tests examples | |
| - name: rustfmt + clippy | |
| run: | | |
| cargo fmt --all -- --check | |
| cargo clippy --all-targets -- -D warnings | |
| - name: Native Rust tests | |
| run: | | |
| cargo test --all-targets | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prerelease: true | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Install locked deps, build and install oxyroute | |
| run: | | |
| set -euo pipefail | |
| uv sync --frozen --extra dev | |
| # `uv sync` can leave a prior wheel; `maturin build` adds another (different platform tag). | |
| # `uv pip install` with two file URLs errors with "conflicting URLs for package oxyroute". | |
| rm -f target/wheels/oxyroute-*.whl | |
| uv run maturin build --release | |
| shopt -s nullglob | |
| wheels=(target/wheels/oxyroute-*.whl) | |
| shopt -u nullglob | |
| if [ "${#wheels[@]}" -ne 1 ] || [ ! -f "${wheels[0]}" ]; then | |
| echo "expected exactly one oxyroute wheel, got: ${#wheels[@]}" | |
| ls -la target/wheels/ 2>/dev/null || true | |
| exit 1 | |
| fi | |
| uv pip install --force-reinstall "${wheels[0]}" | |
| # Full suite includes tests/test_granian_e2e.py (real Granian subprocess, --interface rsgi). | |
| - name: Pytest (isolated dir so repo tree does not shadow the installed package) | |
| run: | | |
| cd "$(mktemp -d)" | |
| UV_PROJECT="$GITHUB_WORKSPACE" uv run python -m pytest "$GITHUB_WORKSPACE/tests" -v |