Skip to content
Merged
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
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
pull_request:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
# Debug info only slows linking and bloats the cache in CI.
CARGO_PROFILE_DEV_DEBUG: 0

jobs:
lint:
name: fmt and clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets --locked -- -D warnings

test:
name: tests
runs-on: ubuntu-latest
services:
# Matches docker-compose.yml; later releases need an auth token.
localstack:
image: localstack/localstack:4.14
ports:
- 4566:4566
env:
SERVICES: s3
options: >-
--health-cmd "curl -sf http://localhost:4566/_localstack/health"
--health-interval 2s
--health-timeout 2s
--health-retries 30
env:
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# The embedding models are large and change rarely.
- uses: actions/cache@v4
with:
path: .fastembed_cache
key: fastembed-${{ hashFiles('src/embed.rs') }}
restore-keys: fastembed-
- name: Unit tests
run: cargo test --locked
# s3vectors skips itself without TEST_VECTOR_BUCKET.
- name: Integration and e2e tests
run: cargo test --locked -- --ignored
- name: Upload e2e server logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-logs
path: target/e2e-logs/
if-no-files-found: ignore
32 changes: 32 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker

# A release build plus the baked-in model takes many minutes, so PRs only
# build the image when something that affects it changes.
on:
pull_request:
paths:
- Dockerfile
- .dockerignore
- Cargo.toml
- Cargo.lock
- .github/workflows/docker.yml
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker:
name: docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
Loading