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
46 changes: 46 additions & 0 deletions .github/actions/build-push-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Build and Push Docker Image'
description: 'Builds and pushes Docker image to ghcr.io with appropriate tags'
inputs:
github_token:
description: 'GitHub token for registry authentication'
required: true

outputs:
image-tags:
description: 'Generated image tags (newline-separated full image references)'
value: ${{ steps.meta.outputs.tags }}

runs:
using: 'composite'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/testbench/testworkflows
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
13 changes: 13 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": [
"github>agentic-layer/renovate-config"
],
"automergeType": "pr",
"packageRules": [
{
"matchDatasources": ["docker"],
"matchPackageNames": ["python"],
"allowedVersions": "< 3.14"
}
]
}
40 changes: 0 additions & 40 deletions .github/workflows/check.yml

This file was deleted.

136 changes: 136 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: CI

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

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

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 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

push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
outputs:
image-tags: ${{ steps.build-push.outputs.image-tags }}

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

- name: Build and push Docker image
id: build-push
uses: ./.github/actions/build-push-image
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

test-e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: push
timeout-minutes: 30
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}

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

- name: Extract image tag
id: extract-tag
run: |
# Get the first tag from the newline-separated list
IMAGE_TAG=$(echo "${{ needs.push.outputs.image-tags }}" | head -n 1)
echo "image-tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
echo "Using image: ${IMAGE_TAG}"

- name: Set up Kubernetes (kind)
uses: 'helm/kind-action@v1'
with:
cluster_name: 'kind'

- name: Install Tilt
run: |
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
tilt version

- name: Run Tilt CI
run: |
# The tilt setup is a bit flaky on a fresh startup, so we retry a few times
for i in {1..3}; do
tilt ci && break
echo "Tilt CI failed, retrying... ($i/3)"
done

- name: Setup Testkube CLI
uses: kubeshop/setup-testkube@v1

- name: Run Test Workflow
run: |
testkube run testworkflow ragas-evaluation-workflow \
--config datasetUrl="http://data-server.data-server:8000/dataset.csv" \
--config agentUrl="http://agent-gateway-krakend.agent-gateway-krakend:10000/weather-agent" \
--config metrics="nv_accuracy context_recall" \
--config workflowName="Testworkflow-Name" \
--config image="${{ steps.extract-tag.outputs.image-tag }}" \
-n testkube \
--watch
86 changes: 0 additions & 86 deletions .github/workflows/push.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
name: Build, Push and Create Release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write

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

- name: Build and push Docker image
uses: ./.github/actions/build-push-image
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Create Install YAML'
run: kustomize build deploy/base > install.yaml

- name: 'Create Release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${tag#v}" \
--generate-notes \
install.yaml
Loading