Skip to content

Commit c68ea09

Browse files
Add Keploy sandbox CI workflow (#6)
Replays linked sandbox suites for the orderflow producer on every pull request to main. Uses --create-branch ${{ github.head_ref }} so each PR gets its own Keploy branch scope. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4a9bd2f commit c68ea09

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Auto-generated by keploy scaffold_pipeline_workflow — edit freely.
2+
# Replays linked sandbox test suites for orderflowproducer on every pull request.
3+
4+
name: Keploy Sandbox Tests
5+
on:
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
keploy-sandbox:
12+
runs-on: ubuntu-latest
13+
# Single source of truth for per-app values. Change any of these
14+
# without hunting through the steps below.
15+
env:
16+
COMPOSE_FILE: docker-compose.yml
17+
APP_SERVICE: producer
18+
CONTAINER_NAME: orderflow-producer
19+
APP_ID: 69f0c0c5b5416c13d84e5c2c
20+
APP_PORT: "8080"
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install keploy enterprise
25+
run: |
26+
curl --silent -O -L https://keploy.io/ent/install.sh
27+
sudo bash install.sh
28+
keploy --version
29+
30+
- name: Bring up app dependencies
31+
run: |
32+
docker compose -f "$COMPOSE_FILE" up -d --wait
33+
docker compose -f "$COMPOSE_FILE" stop "$APP_SERVICE"
34+
docker compose -f "$COMPOSE_FILE" rm -f "$APP_SERVICE"
35+
36+
- name: Run keploy sandbox tests
37+
env:
38+
KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}
39+
run: |
40+
# --create-branch uses find-or-create semantics — first run on
41+
# a PR creates the Keploy branch named after the git branch;
42+
# subsequent runs (force-pushes, retries) reuse the existing
43+
# Keploy branch instead of erroring on the name conflict.
44+
# The Keploy branch name is auto-stamped onto the run's
45+
# CIMetadata.Branch for dashboard display, so there's no
46+
# separate --branch flag any more (dropped to disambiguate
47+
# from the new Keploy-branch flags).
48+
keploy test sandbox \
49+
-c "docker compose -f $COMPOSE_FILE up $APP_SERVICE" \
50+
--container-name "$CONTAINER_NAME" \
51+
--cloud-app-id "$APP_ID" \
52+
--app-url "http://localhost:$APP_PORT" \
53+
--create-branch "${{ github.head_ref }}"
54+
55+
- name: Upload keploy reports
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: keploy-reports
60+
path: keploy/reports
61+
if-no-files-found: ignore
62+
63+
- name: Dump compose logs on failure
64+
if: failure()
65+
run: docker compose -f "$COMPOSE_FILE" logs --tail=200
66+
67+
- name: Tear down
68+
if: always()
69+
run: docker compose -f "$COMPOSE_FILE" down -v

0 commit comments

Comments
 (0)