Repository navigation
134 lines (112 loc) · 3.54 KB
/
Copy pathgo.yml
File metadata and controls
134 lines (112 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Go
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.25.x', '1.24.x', '1.23.x', '1.22.x' ]
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
- name: Get Dependencies
run: go mod download
- name: Test
run: go test -v ./...
- name: Coverage Dependencies
if: matrix.go == '1.25.x'
run: go install github.com/mattn/goveralls@latest
- name: Coverage Reporting Generation
if: matrix.go == '1.25.x'
run: |
export PKGS=$(go list ./... | grep -vE "(gotests/gotests|.*data|templates)" | tr -s '\n' ',' | sed 's/.\{1\}$//')
go test -v -covermode=count -coverpkg=$PKGS -coverprofile=coverage.out ./...
- name: Upload coverage to Coveralls
if: matrix.go == '1.25.x'
run: goveralls -coverprofile=coverage.out -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov
if: matrix.go == '1.25.x'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
fail_ci_if_error: false
verbose: true
e2e-ai-test:
name: E2E AI Tests with Real Ollama
runs-on: ubuntu-latest
needs: test # Run after unit tests pass
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- name: Check out code
uses: actions/checkout@v4
- name: Install Ollama
run: |
echo "Installing Ollama..."
curl -fsSL https://ollama.com/install.sh | sh
echo "Ollama installed successfully"
- name: Start Ollama service in background
run: |
echo "Starting Ollama service..."
ollama serve > /tmp/ollama.log 2>&1 &
OLLAMA_PID=$!
echo "Ollama PID: $OLLAMA_PID"
echo "Waiting for Ollama to start..."
sleep 5
# Verify Ollama is running
if curl -f http://localhost:11434/api/tags; then
echo "✓ Ollama is running"
else
echo "✗ Ollama failed to start"
cat /tmp/ollama.log
exit 1
fi
- name: Pull qwen2.5-coder:0.5b model
run: |
echo "Pulling qwen2.5-coder:0.5b model (400MB, ~2-3 minutes)..."
ollama pull qwen2.5-coder:0.5b
echo "✓ Model downloaded successfully"
- name: Verify model is available
run: |
echo "Verifying qwen2.5-coder:0.5b model..."
if ollama list | grep -q "qwen2.5-coder:0.5b"; then
echo "✓ Model is available"
ollama list
else
echo "✗ Model not found"
ollama list
exit 1
fi
- name: Get Go dependencies
run: go mod download
- name: Run E2E AI Tests
run: |
echo "Running E2E tests with real Ollama + qwen2.5-coder:0.5b..."
echo "These tests validate that AI generation matches golden files"
go test -v -tags=e2e -timeout=15m -coverprofile=e2e-coverage.out -covermode=count ./internal/ai
env:
CI: "true"
GOTESTS_E2E: "true"
- name: Upload E2E coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./e2e-coverage.out
flags: e2e-tests
name: e2e-coverage
fail_ci_if_error: false
verbose: true