-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (84 loc) · 3.06 KB
/
Copy pathsandbox-consumer.example.yaml
File metadata and controls
95 lines (84 loc) · 3.06 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
# Copyright © 2026 OpenCHAMI a Series of LF Projects, LLC
#
# SPDX-License-Identifier: MIT
#
# Example GitHub Actions workflow that runs the integration sandbox against
# the published images, with optional PR-build overrides.
#
# This file is *not* the sandbox repo's own CI (see ci.yaml for that).
# Copy it into a consumer service repo as .github/workflows/sandbox.yml,
# then adapt the IMAGES selection / override matrix to taste. The consumer
# repo's checkout step should point at OpenCHAMI/integration-sandbox so
# the `working-directory: integration-sandbox` step below resolves.
name: integration-sandbox
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
images:
description: "Manifest under integration-sandbox/images/"
type: string
default: "default"
tokensmith_image:
description: "Override SBX_TOKENSMITH_IMAGE (e.g. ghcr.io/openchami/tokensmith:pr-23)"
type: string
default: ""
boot_image:
description: "Override SBX_BOOT_IMAGE"
type: string
default: ""
jobs:
ci:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out the consumer repo (the service under test)
uses: actions/checkout@v7.0.0
with:
path: service
fetch-depth: 0
- name: Check out the sandbox harness
uses: actions/checkout@v7.0.0
with:
repository: OpenCHAMI/integration-sandbox
path: integration-sandbox
# Optional: pin to a sandbox release tag instead of main.
# ref: v1.0.0
- name: Install Go
uses: actions/setup-go@v6.5.0
with:
go-version: "1.24.6"
- name: Install bats
run: sudo apt-get update && sudo apt-get install -y bats
- name: Log in to GHCR (read-only)
uses: docker/login-action@v4.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Pick the manifest. PR runs use the matrix; manual runs use the input.
- name: Compute image overrides
id: imgs
run: |
set -e
echo "IMAGES=${{ inputs.images || 'default' }}" >> "$GITHUB_ENV"
if [ -n "${{ inputs.tokensmith_image }}" ]; then
echo "SBX_TOKENSMITH_IMAGE=${{ inputs.tokensmith_image }}" >> "$GITHUB_ENV"
fi
if [ -n "${{ inputs.boot_image }}" ]; then
echo "SBX_BOOT_IMAGE=${{ inputs.boot_image }}" >> "$GITHUB_ENV"
fi
# If this workflow is hosted in one of the service repos and triggered by a PR,
# auto-pin THAT service to the PR build:
# SBX_TOKENSMITH_IMAGE=ghcr.io/openchami/tokensmith:pr-${{ github.event.pull_request.number }}
# (uncomment as needed)
- name: make ci
working-directory: integration-sandbox
run: make ci
- name: Upload log bundle on failure
if: failure()
uses: actions/upload-artifact@v7.0.1
with:
name: sandbox-logs
path: integration-sandbox/logs/