docs: Update projects #16
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
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # This workflow is based on the build-python-wheels job of | |
| # https://github.com/LalitMaganti/syntaqlite/blob/v0.9.0/.github/workflows/release.yml | |
| name: Build syntaqlite wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/syntaqlite.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-syntaqlite.yml' | |
| - 'docs/packages/syntaqlite.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-syntaqlite.yml' | |
| - 'docs/packages/syntaqlite.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: syntaqlite | |
| version: ${{ inputs.version }} | |
| build_wheel: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Build syntaqlite ${{ matrix.version }} py3-none-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 180 | |
| container: | |
| image: quay.io/pypa/manylinux_2_39_riscv64 | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| SYNTAQLITE_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout syntaqlite v${{ env.SYNTAQLITE_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: LalitMaganti/syntaqlite | |
| ref: v${{ env.SYNTAQLITE_VERSION }} | |
| persist-credentials: false | |
| - name: Use manylinux Python | |
| run: echo "/opt/python/cp312-cp312/bin" >> "$GITHUB_PATH" | |
| - name: Install Rust | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | |
| | sh -s -- -y --default-toolchain stable --profile minimal | |
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| - name: Build CLI | |
| run: cargo build --release -p syntaqlite-cli | |
| - name: Build cdylib (in-process transport) | |
| run: cargo build --release -p syntaqlite --features rpc,dynload | |
| # setuptools only globs licence files next to python/setup.py, so upstream's wheels ship none. | |
| - name: Stage licence | |
| run: cp LICENSE python/ | |
| - name: Build wheel | |
| run: | | |
| python -m pip install --upgrade build | |
| python -m build --wheel --outdir wheelhouse/ python/ | |
| - name: Repair wheel with auditwheel | |
| run: | | |
| python -m pip install auditwheel | |
| python -m auditwheel show wheelhouse/*.whl | |
| python -m auditwheel repair \ | |
| --plat manylinux_2_39_riscv64 \ | |
| --wheel-dir wheelhouse-repaired/ \ | |
| wheelhouse/*.whl | |
| rm wheelhouse/*.whl | |
| mv wheelhouse-repaired/*.whl wheelhouse/ | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: syntaqlite-${{ env.SYNTAQLITE_VERSION }}-py3-none-manylinux_riscv64 | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| test_wheel: | |
| needs: [setup, build_wheel] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| python: ["cp312", "cp313", "cp314", "cp314t"] | |
| name: Test syntaqlite ${{ matrix.version }} ${{ matrix.python }} | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 60 | |
| container: | |
| image: quay.io/pypa/manylinux_2_39_riscv64 | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| SYNTAQLITE_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout syntaqlite v${{ env.SYNTAQLITE_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: LalitMaganti/syntaqlite | |
| ref: v${{ env.SYNTAQLITE_VERSION }} | |
| persist-credentials: false | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: syntaqlite-${{ env.SYNTAQLITE_VERSION }}-py3-none-manylinux_riscv64 | |
| path: dist | |
| - name: Use manylinux Python | |
| run: | | |
| tag="${{ matrix.python }}" | |
| echo "/opt/python/${tag%t}-${tag}/bin" >> "$GITHUB_PATH" | |
| - name: Install wheel | |
| run: python -m pip install dist/*.whl | |
| # upstream's test-install.yml pip job | |
| - name: Verify | |
| run: | | |
| syntaqlite --version | |
| echo "SELECT 1" | syntaqlite fmt | |
| echo "SELECT 1" | syntaqlite analyze | |
| (cd / && python -c 'import syntaqlite; print(syntaqlite.Syntaqlite().format_sql("select 1"))') | |
| # Removing the checkout's package makes the suites import the installed wheel. lsp, | |
| # lsp-diff, amalg*, c-api and upstream-sqlite need upstream's cargo/third_party dev tree. | |
| - name: Run upstream's integration suites against the installed wheel | |
| run: | | |
| pkg="$(cd / && python -c 'import os, syntaqlite; print(os.path.dirname(syntaqlite.__file__))')" | |
| rm -rf python/syntaqlite | |
| SYNTAQLITE_FFI_LIB="${pkg}/lib/libsyntaqlite.so" python tools/run-integration-tests \ | |
| --binary "${pkg}/bin/syntaqlite" \ | |
| --suite python-api \ | |
| --suite ast --suite fmt --suite perfetto-fmt --suite perfetto-val \ | |
| --suite grammar --suite sql-idempotency --suite analyze --suite semantic \ | |
| --suite lineage --suite introspect --suite serve | |
| publish: | |
| name: Publish syntaqlite ${{ matrix.version }} | |
| needs: [setup, build_wheel, test_wheel] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: $/.github/workflows/_publish-wheel.yml | |
| secrets: | |
| app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} | |
| with: | |
| artifact-pattern: syntaqlite-${{ matrix.version }}-*-manylinux_riscv64 |