Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5529fd

Browse files
mizchiclaude
andcommitted
fix: resolve MoonBit LSP CI failures
- Install Moon CLI in CI workflow for proper MoonBit project initialization- Add preTestCommand support to run moon check before testing- Fix moonbit-lsp checkCommand to use --version flag- Change MoonBit LSP installation from global to dev dependencyThis should resolve the exit code 7 errors in CI by ensuring the MoonBitproject is properly initialized before running diagnostics tests.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parent9d78713 commitc5529fd

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ jobs:
5757
with:
5858
components:rust-analyzer
5959

60+
-name:Install MoonBit tools (for examples test)
61+
run:|
62+
# Install Moon CLI and MoonBit LSP
63+
curl -sSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.1.20241202+0150d4161
64+
echo "$HOME/.moon/bin" >> $GITHUB_PATH
65+
pnpm add -D @moonbit/moonbit-lsp
66+
6067
-name:Setup .NET (for F# examples test)
6168
uses:actions/setup-dotnet@v4
6269
with:

‎scripts/check-examples.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface LanguageConfig {
2929
lspCommand?:string;
3030
checkCommand?:string;// Command to check if dependency is installed
3131
installHint?:string;// How to install the dependency
32+
preTestCommand?:string;// Command to run before testing (e.g., to initialize project)
3233
}
3334

3435
constLANGUAGE_CONFIGS:Record<string,LanguageConfig>={
@@ -48,8 +49,9 @@ const LANGUAGE_CONFIGS: Record<string, LanguageConfig> = {
4849
language:"moonbit",
4950
testFiles:["src/test/test_diagnostics.mbt"],
5051
lspCommand:"npx @moonbit/moonbit-lsp",
51-
checkCommand:"npx @moonbit/moonbit-lsp -v",
52+
checkCommand:"npx @moonbit/moonbit-lsp --version",
5253
installHint:"MoonBit LSP is installed via npm",
54+
preTestCommand:"moon check --deny-warn || true",// Initialize project before testing
5355
// Note: MoonBit LSP might fail with exit code 7 if project is not properly initialized
5456
},
5557
"fsharp-project":{
@@ -96,6 +98,15 @@ async function testProjectDiagnostics(
9698
);
9799

98100
try{
101+
// Run pre-test command if specified
102+
if(config.preTestCommand){
103+
try{
104+
execSync(config.preTestCommand,{cwd:projectPath,stdio:"ignore"});
105+
}catch(e){
106+
// Ignore errors from pre-test command (might be expected to fail)
107+
}
108+
}
109+
99110
awaitclient.connect(transport);
100111

101112
lettotalErrors=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp