Skip to content

Commit 430bab1

Browse files
committed
adding the integration test workflow
1 parent 7351bd4 commit 430bab1

File tree

2 files changed

+160
-2
lines changed

2 files changed

+160
-2
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# .github/workflows/release.yml
2+
name: Release AgentEx
3+
4+
on:
5+
workflow_call:
6+
commit-sha:
7+
description: "Commit SHA to release (defaults to latest commit on main)"
8+
required: true
9+
type: string
10+
default: github.sha
11+
12+
permissions:
13+
contents: read # This is needed for checking out code
14+
packages: write # This is needed for pushing to GHCR
15+
16+
env:
17+
AGENTEX_SERVER_IMAGE_NAME: agentex
18+
AGENTEX_AUTH_IMAGE_NAME: agentex-auth
19+
20+
jobs:
21+
build-stable-image:
22+
name: "Push Stable Images to GHCR"
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
# Checkout repository
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ inputs.commit-sha || 'main' }}
31+
32+
# Set up Python and uv for documentation building
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.12"
37+
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v4
40+
with:
41+
version: "0.7.3"
42+
43+
# Set up Docker Buildx
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
# Login to GitHub Container Registry
48+
- name: Login to GitHub Container Registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# Build documentation
56+
- name: Build documentation
57+
working-directory: ./agentex
58+
run: |
59+
# Install docs dependencies
60+
uv sync --group docs
61+
# Build documentation
62+
cd docs && uv run mkdocs build
63+
64+
# Build and push server image to GHCR
65+
- name: Build and push AgentEx server image to GHCR
66+
uses: docker/build-push-action@v5
67+
with:
68+
context: .
69+
file: ./agentex/Dockerfile
70+
push: true
71+
build-args: |
72+
INCLUDE_DOCS=true
73+
tags: |
74+
ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}
75+
cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release
76+
cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release
77+
78+
# Build and push auth image to GHCR
79+
- name: Build and push AgentEx auth image to GHCR
80+
uses: docker/build-push-action@v5
81+
with:
82+
context: .
83+
file: ./agentex-auth/Dockerfile
84+
push: true
85+
tags: |
86+
ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }}
87+
ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}
88+
cache-from: type=gha,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release
89+
cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release
90+
91+
# Summary
92+
- name: Release Summary
93+
run: |
94+
echo "✅ Release complete!"
95+
echo "📦 Server image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}"
96+
echo "🔐 Auth image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }}"

.github/workflows/integration-tests.yml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,68 @@ on:
44
workflow_dispatch:
55
inputs:
66
commit-sha:
7-
description: "Commit SHA to test against"
8-
required: true
7+
description: "Commit SHA to test against (defaults to main)"
8+
required: false
99
type: string
10+
default: main
11+
12+
jobs:
13+
build-images:
14+
name: "Build AgentEx Images"
15+
uses: ./.github/workflows/build-agentex.yml
16+
with:
17+
commit-sha: ${{ inputs.commit-sha || 'main' }}
18+
19+
pull-agent-images:
20+
name: "Pull AgentEx Images"
21+
needs: build-images
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Login to GitHub Container Registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.repository_owner }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Discover available images
32+
id: discover
33+
run: |
34+
echo "🔍 Discovering available images..."
35+
36+
# Get packages, excluding the current repo to avoid conflicts
37+
PACKAGES=$(gh api repos/scaleapi/agentex-python/packages?package_type=container --jq '.[].name') echo "📦 Available packages:"
38+
echo "$PACKAGES"
39+
40+
# Store for other jobs
41+
echo "images<<EOF" >> $GITHUB_OUTPUT
42+
echo "$PACKAGES" >> $GITHUB_OUTPUT
43+
echo "EOF" >> $GITHUB_OUTPUT
44+
45+
# # Pull images
46+
# for package in $PACKAGES; do
47+
# echo "🐳 Pulling ghcr.io/${{ github.repository_owner }}/$package:latest"
48+
# docker pull "ghcr.io/${{ github.repository_owner }}/$package:latest" || echo "⚠️ Couldn't pull $package:latest, trying main..."
49+
# docker pull "ghcr.io/${{ github.repository_owner }}/$package:main" 2>/dev/null || echo "ℹ️ $package:main not available"
50+
# done
51+
#
52+
- name: Pull images from GHCR
53+
run: |
54+
docker pull ghcr.io/your-org/repo-name/image-name:tag
55+
docker pull ghcr.io/your-org/another-repo/service:latest
56+
57+
run-integration-tests:
58+
name: "Run Integration Tests"
59+
needs: build-images
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
with:
65+
ref: ${{ inputs.commit-sha || 'main' }}
66+
67+
- name: Placeholder - Integration Tests
68+
run: |
69+
echo "🧪 Integration tests will run here"
70+
echo "📦 AgentEx images have been built with commit SHA: ${{ inputs.commit-sha || 'main' }}"
71+
echo "🔄 This is where actual integration test commands should be added"

0 commit comments

Comments
 (0)