-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (115 loc) · 4.38 KB
/
Copy pathdocker-validation.yml
File metadata and controls
134 lines (115 loc) · 4.38 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: Docker Validation
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: pulseengine/mcp-validator
jobs:
build-validation-image:
name: Build Validation Docker Image
# Stays on ubuntu-latest: docker buildx + GHCR push; smithy's podman-docker shim is untested for this.
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.validation
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify image was pushed
run: |
echo "Built and pushed image with tags:"
echo "${{ steps.meta.outputs.tags }}"
# Use the short SHA format that matches the metadata tags
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
echo "Checking if sha-tagged image exists:"
docker manifest inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA} || echo "Warning: Image verification failed"
validate-in-container:
name: Run Validation in Container
needs: build-validation-image
# Stays on ubuntu-latest: pulls + runs a container image; smithy podman-docker shim is untested.
runs-on: ubuntu-latest
if: success()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Debug image information
run: |
echo "Registry: ${{ env.REGISTRY }}"
echo "Image name: ${{ env.IMAGE_NAME }}"
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
echo "Full image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA}"
echo "Checking if image exists..."
docker manifest inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA} || echo "Image not found"
- name: Run validation container
run: |
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-e RUST_LOG=info \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${SHORT_SHA} \
mcp-validate --server-url http://test-server:3000
multi-version-testing:
name: Multi-Version Protocol Testing
runs-on: [self-hosted, linux, x64, rust-cpu]
strategy:
matrix:
protocol_version: ["2024-11-05", "2025-03-26"]
transport: ["http", "websocket", "stdio"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.88
- name: Clean procedural macro artifacts
run: |
# Clean procedural macro artifacts to prevent version conflicts
cargo clean -p pulseengine-mcp-macros
cargo clean -p pulseengine-mcp-external-validation
- name: Test protocol version ${{ matrix.protocol_version }} with ${{ matrix.transport }}
run: |
cargo test --package pulseengine-mcp-external-validation \
--features "proptest,fuzzing" --release \
-- --test-threads=1 \
protocol_${{ matrix.protocol_version }}_${{ matrix.transport }}
env:
MCP_PROTOCOL_VERSION: ${{ matrix.protocol_version }}
MCP_TRANSPORT: ${{ matrix.transport }}