This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Bindings v2 #161
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: Run Tests | |
| on: | |
| push: | |
| branches: [main] | |
| tags: [v*] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Go tests on ${{ matrix.name }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: linux_amd64 | |
| os: ubuntu-latest | |
| lib_relpath: libs/linux_amd64/libturso_go.so | |
| - name: linux_arm64 | |
| os: ubuntu-24.04-arm | |
| lib_relpath: libs/linux_arm64/libturso_go.so | |
| - name: linux_musl_amd64 | |
| os: ubuntu-latest | |
| container: alpine:latest | |
| lib_relpath: libs/linux_musl_amd64/libturso_go.so | |
| - name: linux_musl_arm64 | |
| os: ubuntu-24.04-arm | |
| build_musl: true | |
| lib_relpath: libs/linux_musl_arm64/libturso_go.so | |
| - name: macos_amd64 | |
| os: macos-13 | |
| lib_relpath: libs/darwin_amd64/libturso_go.dylib | |
| - name: macos_arm64 | |
| os: macos-14 | |
| lib_relpath: libs/darwin_arm64/libturso_go.dylib | |
| - name: windows_amd64 | |
| os: windows-latest | |
| lib_relpath: libs/windows_amd64/turso_go.dll | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| steps: | |
| - name: Install Alpine dependencies | |
| if: matrix.container == 'alpine:latest' | |
| run: | | |
| apk add --no-cache bash curl gcc musl-dev git go | |
| # Install Rust | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| source $HOME/.cargo/env | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - uses: actions/checkout@v4 | |
| - name: Probe platform library | |
| id: probe | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| p="${{ matrix.lib_relpath }}" | |
| echo "Looking for ${p}" | |
| if [ -f "${p}" ]; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| echo "Library not found; this leg will be skipped." | |
| fi | |
| - name: Skipped (no platform lib) | |
| if: steps.probe.outputs.present != 'true' | |
| run: echo "No ${{ matrix.lib_relpath }} present; skipping." | |
| - name: Install musl tools for cross-compile | |
| if: steps.probe.outputs.present == 'true' && matrix.build_musl == true | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools | |
| - name: Set up Rust | |
| if: steps.probe.outputs.present == 'true' && matrix.container != 'alpine:latest' | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Add musl target | |
| if: steps.probe.outputs.present == 'true' && matrix.build_musl == true | |
| run: rustup target add aarch64-unknown-linux-musl | |
| - uses: actions/setup-go@v5 | |
| if: steps.probe.outputs.present == 'true' && matrix.container != 'alpine:latest' | |
| with: | |
| go-version: "1.23.x" | |
| check-latest: true | |
| - name: Run Go tests | |
| if: steps.probe.outputs.present == 'true' | |
| env: | |
| TURSO_GO_NOCACHE: 1 | |
| shell: bash | |
| run: | | |
| bash build_lib.sh | |
| go test -v ./... |