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
262 changes: 131 additions & 131 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,131 +1,131 @@
name: Integration Tests

on:
push:
branches: [main]
schedule:
- cron: '0 6 * * *' # Daily at 6:00 UTC
workflow_dispatch:
inputs:
chat_model:
description: 'Ollama chat model to use'
required: false
default: 'qwen2.5:0.5b'
embedding_model:
description: 'Ollama embedding model to use'
required: false
default: 'all-minilm:22m'

env:
DOTNET_NOLOGO: true
OLLAMA_CHAT_MODEL: ${{ inputs.chat_model || 'qwen2.5:0.5b' }}
OLLAMA_EMBEDDING_MODEL: ${{ inputs.embedding_model || 'all-minilm:22m' }}
EXTENSIONS_INTEGRATION_TESTS: 'true'
TUI_INTEGRATION_TESTS: 'true'

jobs:
integration:
name: Integration Tests (Ollama)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
checks: write
services:
ollama:
image: ollama/ollama:latest
ports:
- 11434:11434

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x

- name: Wait for Ollama
run: |
echo "⏳ Waiting for Ollama to be ready..."
for i in $(seq 1 60); do
if curl -sf http://localhost:11434/api/version > /dev/null 2>&1; then
echo "✅ Ollama is ready (attempt $i)"
curl -sf http://localhost:11434/api/version
exit 0
fi
echo " Attempt $i/60 — waiting..."
sleep 3
done
echo "❌ Ollama failed to start"
exit 1

- name: Pull models
run: |
echo "📥 Pulling chat model: $OLLAMA_CHAT_MODEL"
curl -sf http://localhost:11434/api/pull \
-d "{\"name\": \"$OLLAMA_CHAT_MODEL\"}" | \
while IFS= read -r line; do
status=$(echo "$line" | jq -r '.status // empty' 2>/dev/null)
[ -n "$status" ] && echo " $status"
done
echo "✅ Chat model ready"

echo "📥 Pulling embedding model: $OLLAMA_EMBEDDING_MODEL"
curl -sf http://localhost:11434/api/pull \
-d "{\"name\": \"$OLLAMA_EMBEDDING_MODEL\"}" | \
while IFS= read -r line; do
status=$(echo "$line" | jq -r '.status // empty' 2>/dev/null)
[ -n "$status" ] && echo " $status"
done
echo "✅ Embedding model ready"

- name: Verify models
run: |
echo "🔍 Available models:"
curl -sf http://localhost:11434/api/tags | jq -r '.models[].name'

- name: Restore
run: dotnet restore JD.SemanticKernel.Extensions.slnx

- name: Build
run: >
dotnet build JD.SemanticKernel.Extensions.slnx
--configuration Release
--no-restore
/p:ContinuousIntegrationBuild=true

- name: Run integration tests
run: >
dotnet test JD.SemanticKernel.Extensions.slnx
--configuration Release
--no-build
--filter "Category=Integration"
--verbosity normal
--logger "trx;LogFileName=integration-results.trx"
--
RunConfiguration.TestSessionTimeout=600000

- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/TestResults/**/*.trx
check_name: Integration Test Results

- name: Summary
if: always()
run: |
echo "## 🧪 Integration Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Setting | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Chat Model | \`$OLLAMA_CHAT_MODEL\` |" >> $GITHUB_STEP_SUMMARY
echo "| Embedding Model | \`$OLLAMA_EMBEDDING_MODEL\` |" >> $GITHUB_STEP_SUMMARY
echo "| Trigger | \`${{ github.event_name }}\` |" >> $GITHUB_STEP_SUMMARY
name: Integration Tests
on:
push:
branches: [main]
schedule:
- cron: '0 6 * * *' # Daily at 6:00 UTC
workflow_dispatch:
inputs:
chat_model:
description: 'Ollama chat model to use'
required: false
default: 'qwen2.5:0.5b'
embedding_model:
description: 'Ollama embedding model to use'
required: false
default: 'all-minilm:22m'
env:
DOTNET_NOLOGO: true
OLLAMA_CHAT_MODEL: ${{ inputs.chat_model || 'qwen2.5:0.5b' }}
OLLAMA_EMBEDDING_MODEL: ${{ inputs.embedding_model || 'all-minilm:22m' }}
EXTENSIONS_INTEGRATION_TESTS: 'true'
TUI_INTEGRATION_TESTS: 'true'
jobs:
integration:
name: Integration Tests (Ollama)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
checks: write
services:
ollama:
image: ollama/ollama:latest
ports:
- 11434:11434
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x
- name: Wait for Ollama
run: |
echo "⏳ Waiting for Ollama to be ready..."
for i in $(seq 1 60); do
if curl -sf http://localhost:11434/api/version > /dev/null 2>&1; then
echo "✅ Ollama is ready (attempt $i)"
curl -sf http://localhost:11434/api/version
exit 0
fi
echo " Attempt $i/60 — waiting..."
sleep 3
done
echo "❌ Ollama failed to start"
exit 1
- name: Pull models
run: |
echo "📥 Pulling chat model: $OLLAMA_CHAT_MODEL"
curl -sf http://localhost:11434/api/pull \
-d "{\"name\": \"$OLLAMA_CHAT_MODEL\"}" | \
while IFS= read -r line; do
status=$(echo "$line" | jq -r '.status // empty' 2>/dev/null)
[ -n "$status" ] && echo " $status"
done
echo "✅ Chat model ready"
echo "📥 Pulling embedding model: $OLLAMA_EMBEDDING_MODEL"
curl -sf http://localhost:11434/api/pull \
-d "{\"name\": \"$OLLAMA_EMBEDDING_MODEL\"}" | \
while IFS= read -r line; do
status=$(echo "$line" | jq -r '.status // empty' 2>/dev/null)
[ -n "$status" ] && echo " $status"
done
echo "✅ Embedding model ready"
- name: Verify models
run: |
echo "🔍 Available models:"
curl -sf http://localhost:11434/api/tags | jq -r '.models[].name'
- name: Restore
run: dotnet restore JD.SemanticKernel.Extensions.slnx
- name: Build
run: >
dotnet build JD.SemanticKernel.Extensions.slnx
--configuration Release
--no-restore
/p:ContinuousIntegrationBuild=true
- name: Run integration tests
run: >
dotnet test JD.SemanticKernel.Extensions.slnx
--configuration Release
--no-build
--filter "Category=Integration"
--verbosity normal
--logger "trx;LogFileName=integration-results.trx"
--
RunConfiguration.TestSessionTimeout=600000
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2.23.0
if: always()
with:
files: |
**/TestResults/**/*.trx
check_name: Integration Test Results
- name: Summary
if: always()
run: |
echo "## 🧪 Integration Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Setting | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Chat Model | \`$OLLAMA_CHAT_MODEL\` |" >> $GITHUB_STEP_SUMMARY
echo "| Embedding Model | \`$OLLAMA_EMBEDDING_MODEL\` |" >> $GITHUB_STEP_SUMMARY
echo "| Trigger | \`${{ github.event_name }}\` |" >> $GITHUB_STEP_SUMMARY
Loading
Loading