Repository navigation
49 lines (49 loc) · 3.03 KB
/
Copy pathci.yml
File metadata and controls
49 lines (49 loc) · 3.03 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
verify:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
GROK_HOME: ${{ github.workspace }}/artifacts/install-home
GROK_DISABLE_AUTOUPDATER: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: oven-sh/setup-bun@v2
- name: Install official CLI
run: npm install --prefix artifacts/cli --no-save --package-lock=false @xai-official/grok@1.0.70
- name: Select installed native CLI
run: node -e 'const fs=require("node:fs"),path=require("node:path");const cli=path.join(process.env.GROK_HOME,"bin",process.platform==="win32"?"grok.exe":"grok");if(!fs.existsSync(cli))throw new Error("Official CLI installation is incomplete");fs.appendFileSync(process.env.GITHUB_ENV,"GROK_TEST_EXECUTABLE="+cli+"\n");'
- name: Verify formatting
run: dotnet format ManagedCode.GrokSharpSDK.slnx --verify-no-changes
- name: Build
run: dotnet build ManagedCode.GrokSharpSDK.slnx -c Release -warnaserror
- name: Qualify caller-owned prompt file on Windows
if: runner.os == 'Windows'
run: dotnet test --solution ManagedCode.GrokSharpSDK.slnx -c Release --no-build --max-parallel-test-modules 1 -v quiet --maximum-parallel-tests 20 --progress on --ansi on --treenode-filter "/*/*/*/ClosedPromptFile_StreamsNativeTerminalResult"
- name: Real CLI integration tests
run: dotnet test --solution ManagedCode.GrokSharpSDK.slnx -c Release --no-build --max-parallel-test-modules 1 -v quiet --maximum-parallel-tests 20 --progress on --ansi on --treenode-filter "/*/*/*/*[RequiresGrokAuth!=true]"
- name: Publish existing integration executable as Native AOT
if: runner.os == 'Linux'
run: dotnet publish GrokSharpSDK.Tests/GrokSharpSDK.Tests.csproj -c Release -r linux-x64 -p:PublishAot=true -o artifacts/aot
- name: Qualify native AOT core and MEAI through real CLI
if: runner.os == 'Linux'
run: artifacts/aot/ManagedCode.GrokSharpSDK.Tests --treenode-filter "/*/*/*/*[RequiresGrokAuth!=true]" --maximum-parallel-tests 20 --progress on --ansi on --output Minimal
- name: Report allowlisted native startup phases on failure
if: failure()
run: node -e 'const fs=require("node:fs"),path=require("node:path");const dir="artifacts/diagnostics";if(fs.existsSync(dir)){for(const file of fs.readdirSync(dir).filter(f=>/^[0-9a-f]{32}\.phases\.json$/.test(f))){const allowed=new Set(["config_load","managed_policy","bootstrap","model_catalog","worker_spawn","leader_connect","acp_initialize","eager_auth","app_init","session_create"]);const phases=JSON.parse(fs.readFileSync(path.join(dir,file),"utf8"));console.log("Native startup phases="+phases.filter(p=>allowed.has(p)).join(","));}}'