Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ensure consistent line endings across all platforms.
# This prevents Windows autocrlf from changing file contents and
# causing test failures or unexpected diffs.
* text=auto eol=lf

# Explicitly mark binary files
*.png binary
*.ico binary
*.jpg binary
*.jpeg binary
*.gif binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary

# Windows-specific files keep CRLF
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
72 changes: 68 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
compile:
name: Compile
runs-on: ubuntu-latest
env:
FASTEMBED_CACHE_DIR: /home/runner/.cache/fastembed
HF_HOME: /home/runner/.cache/fastembed
steps:
- uses: actions/checkout@v6

Expand Down Expand Up @@ -169,10 +172,23 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build (macOS)
runs-on: macos-latest
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
RUSTFLAGS: "-Dwarnings"
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-latest
artifact: claudear-macos
binary_path: target/release/claudear
- name: Windows
os: windows-latest
artifact: claudear-windows
binary_path: target/release/claudear.exe
steps:
- uses: actions/checkout@v6

Expand All @@ -192,15 +208,63 @@ jobs:

- name: Create dashboard dist stub
run: mkdir -p dashboard/dist && touch dashboard/dist/index.html
shell: bash

- name: Build release
run: cargo build --release

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: claudear-macos
path: target/release/claudear
name: ${{ matrix.artifact }}
path: ${{ matrix.binary_path }}

test-windows:
name: Test (Windows)
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Configure git
run: git config --global core.autocrlf false

- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Cache fastembed model
uses: actions/cache@v5
with:
path: ${{ runner.temp }}\.cache\fastembed
key: fastembed-nomic-v15-windows

- name: Compile tests
run: cargo test --all-features --no-run

- name: Warmup embedding model
timeout-minutes: 5
run: cargo test --all-features -- feedback::embeddings::tests::test_warmup_downloads_model --exact --nocapture
env:
FASTEMBED_CACHE_DIR: ${{ runner.temp }}\.cache\fastembed
HF_HOME: ${{ runner.temp }}\.cache\fastembed

- name: Run tests
timeout-minutes: 10
run: cargo test --all-features
env:
FASTEMBED_CACHE_DIR: ${{ runner.temp }}\.cache\fastembed
HF_HOME: ${{ runner.temp }}\.cache\fastembed

dashboard:
name: Dashboard
Expand Down
56 changes: 50 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,58 @@ env:

jobs:
build-release:
name: Build Release
name: Build Release (${{ matrix.asset_name }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: claudear-linux-amd64
binary_name: claudear
- os: macos-latest
target: aarch64-apple-darwin
asset_name: claudear-macos-arm64
binary_name: claudear
- os: windows-latest
target: x86_64-pc-windows-msvc
asset_name: claudear-windows-amd64
binary_name: claudear.exe

steps:
- uses: actions/checkout@v6

- name: Set version from tag
id: version
- name: Set version from tag (Unix)
if: runner.os != 'Windows'
id: version_unix
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
VERSION="${RELEASE_TAG#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
sed -i.bak '/^\[package\]/,/^$/ s/^version = .*/version = "'"${VERSION}"'"/' Cargo.toml && rm -f Cargo.toml.bak

- name: Set version from tag (Windows)
if: runner.os == 'Windows'
id: version_windows
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
shell: pwsh
run: |
$VERSION = $env:RELEASE_TAG -replace '^v', ''
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
(Get-Content Cargo.toml) -replace '^version = ".*"', "version = `"$VERSION`"" | Set-Content Cargo.toml

- name: Resolve version
id: version
shell: bash
run: |
if [ -n "${{ steps.version_unix.outputs.version }}" ]; then
echo "version=${{ steps.version_unix.outputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.version_windows.outputs.version }}" >> $GITHUB_OUTPUT
fi

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -64,18 +92,34 @@ jobs:
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}

- name: Package binary
- name: Package binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p release
cp target/${{ matrix.target }}/release/claudear release/${{ matrix.asset_name }}
cp target/${{ matrix.target }}/release/${{ matrix.binary_name }} release/${{ matrix.asset_name }}
cd release
tar -czvf ${{ matrix.asset_name }}.tar.gz ${{ matrix.asset_name }}

- name: Upload Release Asset
- name: Package binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release
Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "release/${{ matrix.asset_name }}.exe"
Compress-Archive -Path "release/${{ matrix.asset_name }}.exe" -DestinationPath "release/${{ matrix.asset_name }}.zip"

- name: Upload Release Asset (Unix)
if: runner.os != 'Windows'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ github.ref_name }}" release/${{ matrix.asset_name }}.tar.gz --clobber

- name: Upload Release Asset (Windows)
if: runner.os == 'Windows'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ github.ref_name }}" release/${{ matrix.asset_name }}.zip --clobber

publish-docker:
name: Publish Docker Image
runs-on: ubuntu-latest
Expand Down
Loading
Loading