Use runner-provided tools for the dependency audit #6
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: Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_call: | |
| inputs: | |
| ref: | |
| type: string | |
| default: '' | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| include: | |
| - os: ubuntu-latest | |
| python: '3.10' | |
| sqlalchemy: '2.0.14' | |
| - os: macos-latest | |
| python: '3.14' | |
| - os: windows-latest | |
| python: '3.14' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ inputs.ref || github.sha }} | |
| persist-credentials: false | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - run: python -m pip install -e ".[test]" | |
| - name: Test the minimum SQLAlchemy version | |
| if: matrix.sqlalchemy | |
| run: python -m pip install "sqlalchemy==${{ matrix.sqlalchemy }}" | |
| - run: python -m pytest -q --cov --cov-report=term-missing | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ inputs.ref || github.sha }} | |
| persist-credentials: false | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.14' | |
| cache: pip | |
| - run: python -m pip install -e ".[test,dev]" | |
| - run: ruff check . | |
| - run: ruff format --check . | |
| - run: python -m build | |
| - run: python -m twine check --strict dist/* | |
| - name: Install and exercise the built wheel outside the checkout | |
| run: | | |
| python -m venv /tmp/wheel-test | |
| /tmp/wheel-test/bin/python -m pip install dist/*.whl | |
| version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| cd /tmp | |
| /tmp/wheel-test/bin/python "$GITHUB_WORKSPACE/scripts/smoke_test.py" "$version" | |
| - name: Audit runtime dependencies | |
| run: | | |
| /tmp/wheel-test/bin/python -m pip freeze | grep -v '^sqlmodel-encrypted-fields' > /tmp/runtime.txt | |
| pip-audit -r /tmp/runtime.txt |