Repository navigation
140 lines (122 loc) · 4.54 KB
/
Copy pathci.yml
File metadata and controls
140 lines (122 loc) · 4.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
135
136
137
138
139
140
name: CI
on:
push:
branches: [main, Develop]
pull_request:
branches: [main, Develop]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and unit tests
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 21
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Validate the changelog is parseable
run: python3 tools/changelog.py 0.1.0 > /dev/null
- name: Build and test
run: ./mvnw -B verify
- name: Upload test reports
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: surefire-reports
path: path-gateway/target/surefire-reports/
retention-days: 7
helm:
name: Helm chart
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5.1.0
with:
version: v3.16.3
- name: Prometheus rules are valid
run: |
docker run --rm -v "$PWD/deploy/prometheus:/rules:ro" \
--entrypoint /bin/promtool prom/prometheus:v3.1.0 \
check rules /rules/path-rules.yml
- name: Lint
run: helm lint deploy/helm/path --set existingSecret=path-credentials
- name: Render every toggle
run: |
helm template path deploy/helm/path --set existingSecret=x > /dev/null
helm template path deploy/helm/path --set existingSecret=x \
--set autoscaling.enabled=true --set postgres.enabled=true \
--set valkey.enabled=true --set serviceMonitor.enabled=true \
--set prometheusRule.enabled=true > /dev/null
- name: No credentials are rendered inline
run: |
if helm template path deploy/helm/path --set existingSecret=x | grep -q "kind: Secret"; then
echo "::error::The chart rendered a Secret while existingSecret was set"
exit 1
fi
- name: The drain guard must fail closed
run: |
if helm template path deploy/helm/path --set existingSecret=x \
--set drainTimeoutSeconds=60 --set terminationGracePeriodSeconds=30 > /dev/null 2>&1; then
echo "::error::The chart rendered with a grace period below the drain timeout"
exit 1
fi
e2e:
name: End-to-end smoke test
runs-on: ubuntu-26.04
needs: build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 21
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Package
run: ./mvnw -B -DskipTests package
- name: Run the gateway against the mock upstream
run: |
mkdir -p /tmp/opencode
python3 tools/mock-upstream.py 9099 > /tmp/opencode/mock.log 2>&1 &
GATEWAY_ADMIN_TOKEN=test-admin \
GATEWAY_PROMPT_LOGGING=true \
GATEWAY_GUARDRAILS_MODERATION=true \
GATEWAY_SEMANTIC_MODEL=embed-test \
java -jar path-gateway/target/path-*.jar \
> /tmp/opencode/gateway.log 2>&1 &
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:8080/actuator/health > /dev/null; then
echo "gateway up after ${i}s"
break
fi
sleep 1
done
curl -sf http://127.0.0.1:8080/actuator/health
curl -sf http://127.0.0.1:8080/v3/api-docs -o /tmp/opencode/openapi.json
test -s /tmp/opencode/openapi.json
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8080/v1/models | grep -q 'gpt-4o-mini'; then
echo "catalogue seeded after ${i}s"
break
fi
sleep 1
done
python3 tools/smoke_test.py
- name: Upload OpenAPI spec
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: openapi
path: /tmp/opencode/openapi.json
retention-days: 14
- name: Show gateway log on failure
if: failure()
run: tail -60 /tmp/opencode/gateway.log