v0.3.1: harden releases, rename shim, and add Java scaffold #58
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test-lint: | |
| name: Build/Test/Lint (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Normalize line endings on Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| git config --local core.autocrlf false | |
| git config --local core.eol lf | |
| git reset --hard HEAD | |
| - name: Set up Go | |
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable (pinned snapshot) | |
| with: | |
| components: clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| workspaces: "shim -> target" | |
| - name: Set up protoc | |
| uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| version: "31.x" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Verify protoc | |
| run: protoc --version | |
| - name: Build Rust shim (debug) | |
| working-directory: shim | |
| run: cargo build --locked | |
| - name: Run Go tests | |
| shell: pwsh | |
| run: | | |
| $libName = switch ("${{ runner.os }}") { | |
| "Linux" { "libchroma_shim.so" } | |
| "macOS" { "libchroma_shim.dylib" } | |
| "Windows" { "chroma_shim.dll" } | |
| default { throw "Unsupported OS: ${{ runner.os }}" } | |
| } | |
| $env:CHROMA_LIB_PATH = [System.IO.Path]::GetFullPath((Join-Path $env:GITHUB_WORKSPACE "shim/target/debug/$libName")) | |
| Write-Host "CHROMA_LIB_PATH=$env:CHROMA_LIB_PATH" | |
| go test -v ./... | |
| - name: Run Go lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: latest | |
| args: --timeout=30m ./... | |
| - name: Run Rust lint | |
| working-directory: shim | |
| run: cargo clippy --locked -- -D warnings | |
| java-jna: | |
| name: Java JNA Smoke (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Normalize line endings on Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| git config --local core.autocrlf false | |
| git config --local core.eol lf | |
| git reset --hard HEAD | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable (pinned snapshot) | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| workspaces: "shim -> target" | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3 | |
| - name: Build Rust shim (debug) | |
| working-directory: shim | |
| run: cargo build --locked | |
| - name: Run Java JNA smoke tests | |
| shell: pwsh | |
| run: | | |
| $libName = switch ("${{ runner.os }}") { | |
| "Linux" { "libchroma_shim.so" } | |
| "macOS" { "libchroma_shim.dylib" } | |
| "Windows" { "chroma_shim.dll" } | |
| default { throw "Unsupported OS: ${{ runner.os }}" } | |
| } | |
| $env:CHROMA_LIB_PATH = [System.IO.Path]::GetFullPath((Join-Path $env:GITHUB_WORKSPACE "shim/target/debug/$libName")) | |
| Write-Host "CHROMA_LIB_PATH=$env:CHROMA_LIB_PATH" | |
| Push-Location "$env:GITHUB_WORKSPACE/java" | |
| try { | |
| gradle --no-daemon :jna:test | |
| } finally { | |
| Pop-Location | |
| } | |
| java-panama: | |
| name: Java Panama Smoke (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Normalize line endings on Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| git config --local core.autocrlf false | |
| git config --local core.eol lf | |
| git reset --hard HEAD | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable (pinned snapshot) | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| workspaces: "shim -> target" | |
| - name: Set up Java 22 | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| distribution: temurin | |
| java-version: "22" | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3 | |
| - name: Build Rust shim (debug) | |
| working-directory: shim | |
| run: cargo build --locked | |
| - name: Run Java Panama smoke tests | |
| shell: pwsh | |
| run: | | |
| $libName = switch ("${{ runner.os }}") { | |
| "Linux" { "libchroma_shim.so" } | |
| "macOS" { "libchroma_shim.dylib" } | |
| "Windows" { "chroma_shim.dll" } | |
| default { throw "Unsupported OS: ${{ runner.os }}" } | |
| } | |
| $env:CHROMA_LIB_PATH = [System.IO.Path]::GetFullPath((Join-Path $env:GITHUB_WORKSPACE "shim/target/debug/$libName")) | |
| Write-Host "CHROMA_LIB_PATH=$env:CHROMA_LIB_PATH" | |
| Push-Location "$env:GITHUB_WORKSPACE/java" | |
| try { | |
| gradle --no-daemon :panama:test | |
| } finally { | |
| Pop-Location | |
| } |