Add support for Ollama #271
This file contains 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: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
components: rustfmt, clippy | |
toolchain: nightly | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-nightly-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check | |
test: | |
needs: lint | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
rust: [nightly, stable] | |
runs-on: ${{ matrix.os }} | |
continue-on-error: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
profile: minimal | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.rust }}- | |
- name: Install fish on linux | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt-get install fish | |
- name: Install fish on macos | |
if: startsWith(matrix.os, 'macos') | |
run: brew install fish | |
- name: Install ollama | |
run: curl -fsSL https://ollama.com/install.sh | sh | |
- name: Run ollama | |
run: | | |
ollama serve & | |
ollama pull SlyOtis/git-auto-message:latest | |
- name: Run integration tests | |
run: | | |
./scripts/integration-tests | |
cargo build --release | |
cargo test --release | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |