Skip to content

Commit 2dfcf5e

Browse files
committed
Add opencode integration validation to workflow
1 parent 159997c commit 2dfcf5e

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13+
1314
- uses: actions/checkout@v4
15+
1416
- uses: cachix/install-nix-action@v25
1517
with:
1618
nix_path: nixpkgs=channel:nixos-unstable
19+
1720
- uses: cachix/cachix-action@v14
1821
with:
1922
name: rime
@@ -40,3 +43,39 @@ jobs:
4043
echo "Validation failed: rime did not connect to Claude Code"
4144
exit 1
4245
46+
- name: Integration with opencode
47+
run: |
48+
export HOME=$GITHUB_WORKSPACE/temp_home_opencode
49+
export XDG_CONFIG_HOME=$HOME/.config
50+
mkdir -p $XDG_CONFIG_HOME/opencode
51+
mkdir -p $HOME/.opencode
52+
53+
# Create config in multiple possible locations
54+
CONFIG_CONTENT='{
55+
"mcp": {
56+
"rime": {
57+
"command": ["'"$GITHUB_WORKSPACE"'/result/bin/rime", "stdio"],
58+
"enabled": true,
59+
"type": "local"
60+
}
61+
}
62+
}'
63+
64+
echo "$CONFIG_CONTENT" > $XDG_CONFIG_HOME/opencode/config.json
65+
echo "$CONFIG_CONTENT" > $HOME/.opencode/config.json
66+
echo "$CONFIG_CONTENT" > opencode.json
67+
68+
for i in {1..3}; do
69+
echo "Checking opencode MCP health (attempt $i)..."
70+
# Pass HOME and XDG_CONFIG_HOME explicitly to nix run
71+
OUTPUT=$(HOME=$HOME XDG_CONFIG_HOME=$XDG_CONFIG_HOME nix run github:sst/opencode -- mcp list 2>&1)
72+
echo "$OUTPUT"
73+
if echo "$OUTPUT" | grep -qi "rime.*connected"; then
74+
echo "Validation successful!"
75+
exit 0
76+
fi
77+
sleep 5
78+
done
79+
echo "Validation failed: rime did not connect to opencode"
80+
find $HOME -name "*.json"
81+
exit 1

0 commit comments

Comments
 (0)