Improve runtime compatibility #130
Workflow file for this run
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: Workspace CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: workspace-ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: "3.14" | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@1.94.0 | |
| - name: Sync development dependencies | |
| run: uv sync --group dev | |
| - name: Configure PyO3 test environment | |
| shell: bash | |
| run: | | |
| PYTHON_BIN="$(uv run --group dev python - <<'PY' | |
| import sys | |
| print(sys.executable) | |
| PY | |
| )" | |
| PYTHON_LIBDIR="$(uv run --group dev python - <<'PY' | |
| import sysconfig | |
| print(sysconfig.get_config_var("LIBDIR") or "") | |
| PY | |
| )" | |
| echo "PYO3_PYTHON=$PYTHON_BIN" >> "$GITHUB_ENV" | |
| if [ -n "$PYTHON_LIBDIR" ]; then | |
| echo "LD_LIBRARY_PATH=$PYTHON_LIBDIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV" | |
| echo "LIBRARY_PATH=$PYTHON_LIBDIR${LIBRARY_PATH:+:$LIBRARY_PATH}" >> "$GITHUB_ENV" | |
| fi | |
| - name: Run Rust tests | |
| run: cargo test --manifest-path rust/Cargo.toml --workspace --tests | |
| - name: Run Python tests | |
| run: uv run --group dev pytest json-tstring/tests toml-tstring/tests yaml-tstring/tests -q | |
| - name: Check formatting | |
| run: uv run --group dev ruff format --check json-tstring toml-tstring yaml-tstring tstring-core rust/python-bindings/python | |
| - name: Run Ruff | |
| run: uv run --group dev ruff check json-tstring/src toml-tstring/src yaml-tstring/src tstring-core/src rust/python-bindings/python/tstring_bindings | |
| - name: Run type checks | |
| run: uv run --group dev ty check json-tstring/src json-tstring/tests toml-tstring/src toml-tstring/tests yaml-tstring/src yaml-tstring/tests tstring-core/src rust/python-bindings/python | |
| - name: Build distributions | |
| run: | | |
| uv build tstring-core --out-dir dist | |
| uv build json-tstring --out-dir dist | |
| uv build toml-tstring --out-dir dist | |
| uv build yaml-tstring --out-dir dist | |
| uv build rust/python-bindings --out-dir dist | |
| - name: Check distribution metadata | |
| run: uvx twine check dist/* | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-distributions | |
| path: dist/* |