-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (44 loc) · 1.87 KB
/
Copy pathagent-image-smoke.yaml
File metadata and controls
53 lines (44 loc) · 1.87 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
# .github/workflows/agent-image-smoke.yaml
#
# Per-PR smoke test for the agent image. The image is `FROM` the upstream
# nousresearch/hermes-agent s6 runtime (see images/hermes-agent/Dockerfile), so
# we verify the operator-facing contract: the build succeeds, the hermes CLI and
# the `gateway` subcommand the operator runs are present, and the upstream s6
# entrypoint (/init) is inherited. Does NOT push.
name: agent-image-smoke
on:
pull_request:
paths:
- 'images/hermes-agent/**'
- '.github/workflows/agent-image-smoke.yaml'
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Set up Buildx
uses: docker/setup-buildx-action@v4
- name: Build image locally (amd64)
run: |
docker buildx build \
--platform linux/amd64 \
--load \
-t hermes-agent:smoke \
images/hermes-agent
- name: "Smoke: hermes CLI --help exits 0"
run: docker run --rm --entrypoint hermes-agent hermes-agent:smoke --help >/dev/null
- name: "Smoke: gateway subcommand present (the operator runs `gateway run`)"
run: docker run --rm --entrypoint hermes hermes-agent:smoke gateway --help >/dev/null
- name: "Smoke: inherits the upstream s6 entrypoint (/init) and HERMES_HOME"
run: |
set -eux
entrypoint=$(docker image inspect hermes-agent:smoke --format '{{json .Config.Entrypoint}}')
echo "${entrypoint}" | grep -q '/init'
docker image inspect hermes-agent:smoke --format '{{range .Config.Env}}{{println .}}{{end}}' | grep -qx 'HERMES_HOME=/opt/data'
- name: "Smoke: operator version label present"
run: |
set -eux
docker image inspect hermes-agent:smoke \
--format '{{index .Config.Labels "hermes.agent/version"}}' | grep -qE '^v[0-9]'