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
64 changes: 23 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,31 @@
name: CI
name: Check

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'renovate/**'
pull_request:

jobs:
check:
name: Code Quality Checks
python:
runs-on: ubuntu-latest

steps:
- name: Clone the code
uses: 'actions/checkout@v5'
- name: Checkout
uses: 'actions/checkout@v6'

- name: Install uv
uses: 'astral-sh/setup-uv@v6'
uses: 'astral-sh/setup-uv@v7'
with:
version: "0.8.17"
version: "0.9.26"
enable-cache: true

- name: Setup Python
uses: 'actions/setup-python@v6'
with:
python-version-file: ".python-version"

- name: Install Dependencies
run: uv sync

- name: Run Checks
run: uv run poe check

test:
name: Unit Tests
runs-on: ubuntu-latest
permissions:
contents: 'read'

steps:
- name: Clone the code
uses: 'actions/checkout@v5'

- name: Install uv
uses: 'astral-sh/setup-uv@v6'
with:
version: "0.8.17"
enable-cache: true

- name: Setup Python
uses: 'actions/setup-python@v6'
with:
python-version-file: ".python-version"

- name: Install Dependencies
run: uv sync

- name: Run Tests
run: uv run poe test

Expand All @@ -83,6 +51,20 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

helm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: 'actions/checkout@v6'

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'v3.14.0'

- name: Lint Helm Chart
run: helm lint chart/

test-e2e:
name: E2E Tests
runs-on: ubuntu-latest
Expand All @@ -92,8 +74,8 @@ jobs:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

steps:
- name: Clone the code
uses: 'actions/checkout@v5'
- name: Checkout
uses: 'actions/checkout@v6'

- name: Extract image tag
id: extract-tag
Expand Down
68 changes: 65 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
permissions:
contents: write
packages: write
id-token: write

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

Expand Down Expand Up @@ -50,3 +49,66 @@ jobs:
--title="${tag#v}" \
--generate-notes \
install.yaml

helm-chart:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'v3.14.0'

- name: Determine Chart Version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
# For tags: use semver (e.g., v1.2.3 → 1.2.3)
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}" # Remove 'v' prefix
else
# For branches/PRs: use pre-release version (e.g., 0.0.0-main-abc1234)
GIT_BRANCH="${{ github.ref_name }}"
GIT_SHA="${{ github.sha }}"
# Replace slashes with dashes for branch names (e.g., feature/foo → feature-foo)
GIT_BRANCH="${GIT_BRANCH//\//-}"
VERSION="0.0.0-${GIT_BRANCH}-${GIT_SHA:0:7}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Chart Version: $VERSION"

- name: Update Chart Version
run: |
# Update Chart.yaml with dynamic version
sed -i "s|^version:.*|version: ${{ steps.version.outputs.version }}|" chart/Chart.yaml
sed -i "s|^appVersion:.*|appVersion: ${{ steps.version.outputs.version }}|" chart/Chart.yaml

- name: Update Image Tags for Release
run: |
# Update image tags in values.yaml to use the versioned images
# This assumes Docker images were built with the same git tag
sed -i "s|tag: latest|tag: ${{ steps.version.outputs.version }}|g" chart/values.yaml

- name: Package Helm Chart
run: |
helm package chart/ --destination .

- name: Log into Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Helm Chart to OCI Registry
if: startsWith(github.ref, 'refs/tags/v')
run: |
helm push *.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^chart/templates/
- id: check-ast
- id: check-case-conflict
- id: check-json
Expand All @@ -17,13 +18,6 @@ repos:
- id: requirements-txt-fixer
- id: mixed-line-ending

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.11
hooks:
# Update the uv lockfile
- id: uv-lock

- repo: local
hooks:
- id: python-lint
Expand All @@ -32,9 +26,17 @@ repos:
entry: "uv run poe lint"
types_or: [ python ]
pass_filenames: false

- id: python-ruff
name: python-ruff
language: system
entry: "uv run poe ruff"
types_or: [ python ]
pass_filenames: false

- id: helm-lint
name: Helm Lint
entry: helm lint chart/
language: system
pass_filenames: false
files: ^chart/
15 changes: 13 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@ helm_resource(
'testkube',
'oci://docker.io/kubeshop/testkube',
namespace='testkube',
flags=['--version=2.5.3', '--create-namespace', '--values=deploy/local/testkube/values.yaml', '--wait',
flags=['--version=2.5.3', '--values=deploy/local/testkube/values.yaml', '--wait',
'--wait-for-jobs', '--timeout=10m'],
)

# Apply Kubernetes manifests
# Deploy testbench Helm chart
k8s_yaml(helm(
'chart',
name='testbench',
namespace='testkube',
values=['chart/values.yaml'],
set=[
'image.repository=testworkflows',
],
))

# Apply local development manifests
k8s_yaml(kustomize('deploy/local'))

k8s_resource('ai-gateway-litellm', port_forwards=['11001:4000'])
Expand Down
23 changes: 23 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
18 changes: 18 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: testbench
description: A Helm chart for RAGAS-based agent evaluation via Testkube workflows
type: application
version: 0.1.0
appVersion: "0.1.0"
keywords:
- ragas
- testkube
- evaluation
- testing
- a2a
maintainers:
- name: Agentic Layer Team
url: https://docs.agentic-layer.ai/
home: https://github.com/agentic-layer/testbench
sources:
- https://github.com/agentic-layer/testbench
Loading