Skip to content

build(deps-dev): bump eslint from 10.7.0 to 10.8.0 in the eslint grou… #1018

build(deps-dev): bump eslint from 10.7.0 to 10.8.0 in the eslint grou…

build(deps-dev): bump eslint from 10.7.0 to 10.8.0 in the eslint grou… #1018

Workflow file for this run

name: test
on: [push, pull_request]
permissions:
contents: read
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v7
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci --prefer-offline
- name: Run unit tests
run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
integration:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v7
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci --prefer-offline
- name: Build package
run: npm run build
- name: Verify CLI via npm exec
run: |
package_archive=$(npm pack | tail -n 1)
temp_dir=$(mktemp -d)
cd "$temp_dir"
output=$(npm exec --yes --package "${GITHUB_WORKSPACE}/${package_archive}" code-ollama -- --help)
printf '%s\n' "$output"
grep -F "code-ollama" <<< "$output"
grep -F "run <model> <prompt>" <<< "$output"
- name: Setup Ollama
uses: ai-action/setup-ollama@v2
- name: Install CLI
run: |
package_archive=$(npm pack | tail -n 1)
npm install --global "./$package_archive"
- name: Verify CLI version
run: |
actual=$(code-ollama --version)
printf '%s\n' "$actual"
expected="$(node -p "require('./package.json').version")"
grep -F "$expected" <<< "$actual"
- name: Verify CLI help
run: |
output=$(code-ollama --help)
printf '%s\n' "$output"
grep -F "code-ollama" <<< "$output"
grep -F "run <model> <prompt>" <<< "$output"
- name: Cache model
uses: actions/cache@v6
with:
path: ~/.ollama
key: ${{ runner.os }}-ollama
- name: Pull model
run: ollama pull gemma4:e2b
- name: Run doctor
run: |
output=$(code-ollama doctor)
printf '%s\n' "$output"
grep -F "Ollama connection Reachable" <<< "$output"
grep -F "gemma4:e2b" <<< "$output"
# Change year to 2025 so AI can edit it back to 2026
- name: Setup test
run: |
sed -i 's/Copyright (c) 2026/Copyright (c) 2025/' LICENSE
grep -F "2025" LICENSE
- name: Edit with CLI
run: |
log="$RUNNER_TEMP/code-ollama-integration.log"
set +e
timeout 300s code-ollama run --trust gemma4:e2b "Change 2025 to 2026 in ./LICENSE" 2>&1 | tee "$log"
status=${PIPESTATUS[0]}
set -e
if (( status != 0 )); then
echo "::error::code-ollama exited with status $status"
exit "$status"
fi
if ! grep -q '[^[:space:]]' "$log"; then
echo "::error::code-ollama produced no non-whitespace output"
exit 1
fi
! grep -F "Error:" "$log"
- name: Verify edit
run: |
grep -F "Copyright (c) 2026" LICENSE
! grep -F "2025" LICENSE || (echo "Year 2025 still present in LICENSE" && exit 1)