Skip to content

Commit 44247ff

Browse files
committed
feat(ci): add tests and update yaml
1 parent ea22938 commit 44247ff

File tree

1 file changed

+91
-6
lines changed

1 file changed

+91
-6
lines changed

.github/workflows/build-cli-binaries.yml

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ jobs:
3131
target: linux-x64
3232
- os: ubuntu-24.04-arm
3333
target: linux-arm64
34-
- os: macos-latest
34+
- os: macos-13 # x64/Intel
3535
target: darwin-x64
36-
- os: macos-13
37-
target: darwin-x64-intel
36+
- os: macos-latest # ARM64/M1
37+
target: darwin-arm64
3838
- os: windows-latest
3939
target: win32-x64
40-
- os: windows-11-arm
41-
target: win32-arm64
40+
# Note: Windows ARM64 currently runs x64 binaries through emulation
41+
# Native ARM64 support is not yet available in Bun
42+
# See: https://github.com/oven-sh/bun/pull/11430
43+
# - os: windows-11-arm
44+
# target: win32-arm64
4245

4346
runs-on: ${{ matrix.os }}
4447

@@ -101,4 +104,86 @@ jobs:
101104
with:
102105
name: genkit-${{ matrix.target }}
103106
path: genkit-tools/cli/dist/bin/genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }}
104-
retention-days: 1
107+
retention-days: 1
108+
109+
test:
110+
needs: build
111+
strategy:
112+
matrix:
113+
include:
114+
- os: ubuntu-latest
115+
target: linux-x64
116+
- os: ubuntu-24.04-arm
117+
target: linux-arm64
118+
- os: macos-13
119+
target: darwin-x64
120+
- os: macos-latest
121+
target: darwin-arm64
122+
- os: windows-latest
123+
target: win32-x64
124+
125+
runs-on: ${{ matrix.os }}
126+
127+
steps:
128+
- name: Set binary extension
129+
id: binary
130+
shell: bash
131+
run: |
132+
if [[ "${{ matrix.target }}" == win32-* ]]; then
133+
echo "ext=.exe" >> $GITHUB_OUTPUT
134+
else
135+
echo "ext=" >> $GITHUB_OUTPUT
136+
fi
137+
138+
- name: Download binary artifact
139+
uses: actions/download-artifact@v4
140+
with:
141+
name: genkit-${{ matrix.target }}
142+
path: ./
143+
144+
- name: Make binary executable (Unix)
145+
if: runner.os != 'Windows'
146+
run: chmod +x genkit-${{ matrix.target }}
147+
148+
- name: Test --help command
149+
shell: bash
150+
run: |
151+
echo "Testing genkit --help"
152+
./genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }} --help
153+
154+
- name: Test --version command
155+
shell: bash
156+
run: |
157+
echo "Testing genkit --version"
158+
./genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }} --version
159+
160+
- name: Verify UI commands exist
161+
shell: bash
162+
run: |
163+
echo "Verifying UI commands are available"
164+
./genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }} ui:start --help
165+
./genkit-${{ matrix.target }}${{ steps.binary.outputs.ext }} ui:stop --help
166+
167+
- name: Test basic UI functionality (Unix only)
168+
if: runner.os != 'Windows'
169+
shell: bash
170+
run: |
171+
echo "Testing genkit ui:start"
172+
# Start the UI in the background
173+
./genkit-${{ matrix.target }} ui:start &
174+
UI_PID=$!
175+
176+
# Give it some time to start
177+
sleep 5
178+
179+
# Check if the process is still running
180+
if ps -p $UI_PID > /dev/null 2>&1; then
181+
echo "UI process started successfully (PID: $UI_PID)"
182+
# Clean up - kill the process
183+
kill $UI_PID 2>/dev/null || true
184+
sleep 2
185+
echo "UI process terminated"
186+
else
187+
echo "UI process failed to start or exited immediately"
188+
# This might be expected without a proper project, so we don't fail
189+
fi

0 commit comments

Comments
 (0)