|
49 | 49 | exit-code: 1 |
50 | 50 | severity: CRITICAL,HIGH |
51 | 51 | trivyignores: .trivyignore |
| 52 | + |
| 53 | + integration-test: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + needs: build |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v4 |
| 59 | + |
| 60 | + - name: Install k3d |
| 61 | + uses: AbsaOSS/k3d-action@v2 |
| 62 | + with: |
| 63 | + cluster-name: test |
| 64 | + args: --wait |
| 65 | + |
| 66 | + - name: Pull image and import into cluster |
| 67 | + run: | |
| 68 | + docker pull ghcr.io/pprecel/claude-warmup:${{ github.sha }} |
| 69 | + k3d image import ghcr.io/pprecel/claude-warmup:${{ github.sha }} -c test |
| 70 | +
|
| 71 | + - name: Create secret |
| 72 | + run: | |
| 73 | + kubectl create secret generic redis-credentials \ |
| 74 | + --from-literal=redis-password=${{ secrets.TEST_REDIS_PASSWORD }} |
| 75 | +
|
| 76 | + - name: Deploy application |
| 77 | + run: | |
| 78 | + kubectl apply -f k8s/ |
| 79 | + kubectl set image deployment/claude-warmup \ |
| 80 | + claude-warmup=ghcr.io/pprecel/claude-warmup:${{ github.sha }} |
| 81 | + kubectl scale deployment/claude-warmup --replicas=1 |
| 82 | + kubectl patch deployment/claude-warmup \ |
| 83 | + -p '{"spec":{"template":{"spec":{"containers":[{"name":"claude-warmup","imagePullPolicy":"Never"}]}}}}' |
| 84 | + kubectl delete networkpolicy app-egress --ignore-not-found |
| 85 | +
|
| 86 | + - name: Wait for rollout |
| 87 | + run: | |
| 88 | + kubectl rollout status deployment/redis --timeout=120s |
| 89 | + kubectl rollout status deployment/claude-warmup --timeout=120s |
| 90 | +
|
| 91 | + - name: Run integration test |
| 92 | + run: | |
| 93 | + kubectl port-forward svc/claude-warmup 8080:80 & |
| 94 | + PF_PID=$! |
| 95 | + sleep 3 |
| 96 | + RESPONSE=$(curl -sf http://localhost:8080) |
| 97 | + echo "Response: $RESPONSE" |
| 98 | + echo "$RESPONSE" | grep -q "hello claude warmup (requests: 1)" |
| 99 | + RESPONSE=$(curl -sf http://localhost:8080) |
| 100 | + echo "Response: $RESPONSE" |
| 101 | + echo "$RESPONSE" | grep -q "hello claude warmup (requests: 2)" |
| 102 | + kill $PF_PID || true |
| 103 | +
|
| 104 | + - name: Verify Redis requires authentication |
| 105 | + run: | |
| 106 | + kubectl exec deployment/redis -- redis-cli ping 2>&1 | grep -q "NOAUTH" |
| 107 | + kubectl exec deployment/redis -- redis-cli -a ${{ secrets.TEST_REDIS_PASSWORD }} ping 2>&1 | grep -q "PONG" |
0 commit comments