Skip to content

Exported and documented the Ollama chat endpoint #9

Exported and documented the Ollama chat endpoint

Exported and documented the Ollama chat endpoint #9

name: Rust + Docker CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:18.2
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: bot_database
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d bot_database"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/bot_database
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Install sqlx-cli
run: cargo install sqlx-cli
- name: Wait for Postgres
run: |
until pg_isready -h localhost -p 5432; do
echo "Waiting for Postgres..."
sleep 2
done
- name: Run database migrations
run: sqlx migrate run
- name: Build
run: cargo build --verbose --all-features
- name: Run tests
run: cargo test --verbose --all-features -- --nocapture
- name: Create filler .env for Docker build
run: |
echo "DATABASE_URL=${DATABASE_URL}" > .env
echo "BOT_TOKEN=dummy_token" >> .env
- name: Build Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)