-
Notifications
You must be signed in to change notification settings - Fork 5
147 lines (135 loc) · 4.75 KB
/
Copy pathpost-release-smoke.yml
File metadata and controls
147 lines (135 loc) · 4.75 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
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Post-Release Smoke
on:
workflow_run:
workflows: ["Update Homebrew Formula"]
types: [completed]
workflow_dispatch:
inputs:
version:
description: "Version to smoke-test (without leading v), e.g. 0.5.10"
required: true
type: string
permissions: {}
concurrency:
group: post-release-smoke-${{ github.event.workflow_run.id || inputs.version }}
cancel-in-progress: true
jobs:
resolve-version:
name: Resolve target version
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
outputs:
version: ${{ steps.pick.outputs.version }}
steps:
- name: Download release-version artifact (workflow_run)
if: ${{ github.event_name == 'workflow_run' }}
uses: actions/download-artifact@v8
with:
name: release-version
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Pick version from artifact or input
id: pick
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
DISPATCH_VERSION: ${{ inputs.version }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
VERSION="$DISPATCH_VERSION"
else
VERSION=$(cat release-version.txt)
fi
if [ -z "$VERSION" ]; then
echo "::error::Could not resolve version"
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Resolved version: $VERSION"
npm-smoke:
name: npm install (${{ matrix.os }})
needs: resolve-version
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Wait for npm registry propagation
shell: bash
env:
VERSION: ${{ needs.resolve-version.outputs.version }}
run: |
for i in $(seq 1 30); do
if npm view "@fitlab-ai/agent-infra@${VERSION}" version >/dev/null 2>&1; then
echo "Package @fitlab-ai/agent-infra@${VERSION} available on npm"
exit 0
fi
echo "Waiting for npm registry... (attempt $i/30)"
sleep 10
done
echo "::error::Package @fitlab-ai/agent-infra@${VERSION} not found on npm after 5 minutes"
exit 1
- name: Smoke test - agent-infra version
shell: bash
env:
VERSION: ${{ needs.resolve-version.outputs.version }}
run: |
OUTPUT=$(npx -y "@fitlab-ai/agent-infra@${VERSION}" version)
echo "$OUTPUT"
echo "$OUTPUT" | grep -F "${VERSION}"
- name: Smoke test - sandbox --help
shell: bash
env:
VERSION: ${{ needs.resolve-version.outputs.version }}
run: |
npx -y "@fitlab-ai/agent-infra@${VERSION}" sandbox --help
brew-smoke:
name: brew install (macos-latest)
needs: resolve-version
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Wait for Homebrew tap formula bottle block
shell: bash
env:
VERSION: ${{ needs.resolve-version.outputs.version }}
run: |
FORMULA_URL="https://raw.githubusercontent.com/fitlab-ai/homebrew-tap/main/Formula/agent-infra.rb"
for i in $(seq 1 60); do
BODY=$(curl -fsSL "$FORMULA_URL" 2>/dev/null || true)
if printf '%s' "$BODY" | grep -qF "agent-infra-${VERSION}.tgz" \
&& printf '%s' "$BODY" | grep -q "bottle do"; then
echo "Formula updated to ${VERSION} with bottle block"
exit 0
fi
echo "Waiting for tap formula bottle block... (attempt $i/60)"
sleep 10
done
echo "::error::Tap formula bottle block for ${VERSION} not present after 10 minutes"
exit 1
- name: brew install (must pour from bottle)
shell: bash
run: |
brew install --verbose fitlab-ai/tap/agent-infra 2>&1 | tee install.log
if ! grep -q "Pouring agent-infra-" install.log; then
echo "::error::agent-infra was not poured from a bottle (no 'Pouring agent-infra-' in output)"
exit 1
fi
- name: Smoke test - agent-infra version
shell: bash
env:
VERSION: ${{ needs.resolve-version.outputs.version }}
run: |
OUTPUT=$(agent-infra version)
echo "$OUTPUT"
echo "$OUTPUT" | grep -F "${VERSION}"