Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 16 additions & 146 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,157 +4,27 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

env:
XLINGS_VERSION: v0.4.0

jobs:
build-linux:
runs-on: ubuntu-24.04
build:
name: build (linux x86_64, mcpp)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install system deps
run: |
sudo apt-get update -qq
sudo apt-get install -y curl git build-essential
- uses: actions/checkout@v4

- name: Install Xlings
- name: Install xlings
env:
XLINGS_NON_INTERACTIVE: 1
run: |
VERSION_NUM="${XLINGS_VERSION#v}"
TARBALL="xlings-${VERSION_NUM}-linux-x86_64.tar.gz"
curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
chmod +x "$EXTRACT_DIR/bin/xlings"
"$EXTRACT_DIR/bin/xlings" self install
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"

- name: Install project dependencies via Xlings
run: |
xlings install
xmake --version
gcc --version

- name: Build with xmake
run: |
xmake f -m release -y -vvD
xmake -a -j"$(nproc)"

- name: Run tests
XLINGS_VERSION: 0.4.25
run: |
xmake run test_socket -y
xmake run test_tls -y
xmake run test_http -y
xmake run test_sse -y
xmake run test_http_stream -y
xmake run test_proxy -y
xmake run test_integration -y
xmake run test_types -y
xmake run test_serialization -y
xmake run test_coro -y
xmake run test_client -y
xmake run test_openai_serialize -y
xmake run test_anthropic_serialize -y
xmake run test_tool_calling -y
xmake run test_structured_output -y
xmake run test_embeddings -y
xmake run test_llmapi_integration -y
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
curl -fsSL -o "/tmp/${tarball}" \
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
tar -xzf "/tmp/${tarball}" -C /tmp
"/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"

build-macos:
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Xlings
env:
XLINGS_NON_INTERACTIVE: 1
run: |
VERSION_NUM="${XLINGS_VERSION#v}"
TARBALL="xlings-${VERSION_NUM}-macosx-arm64.tar.gz"
curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true
chmod +x "$EXTRACT_DIR/bin/xlings"
"$EXTRACT_DIR/bin/xlings" self install
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
- name: Install workspace tools (.xlings.json → mcpp 0.0.3)
run: xlings install -y

- name: Install project dependencies via Xlings
run: |
xlings install
clang --version

- name: Configure xmake
run: |
LLVM_ROOT="$HOME/.xlings/data/xpkgs/xim-x-llvm"
LLVM_SDK=$(find "$LLVM_ROOT" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -1)
test -d "$LLVM_SDK"
"$LLVM_SDK/bin/clang++" --version
xmake f -m release --toolchain=llvm --sdk="$LLVM_SDK" -y -vvD

- name: Build with xmake
run: xmake -a -j"$(sysctl -n hw.logicalcpu)"

- name: Run tests
run: |
xmake run test_socket -y
xmake run test_tls -y
xmake run test_http -y
xmake run test_sse -y
xmake run test_http_stream -y
xmake run test_proxy -y
xmake run test_integration -y
xmake run test_types -y
xmake run test_serialization -y
xmake run test_coro -y
xmake run test_client -y
xmake run test_openai_serialize -y
xmake run test_anthropic_serialize -y
xmake run test_tool_calling -y
xmake run test_structured_output -y
xmake run test_embeddings -y
xmake run test_llmapi_integration -y

build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest

- name: Build with xmake
shell: pwsh
run: |
xmake f -m release -y -vvD
xmake -a -j$env:NUMBER_OF_PROCESSORS

- name: Run tests
shell: pwsh
run: |
xmake run test_socket -y
xmake run test_tls -y
xmake run test_http -y
xmake run test_sse -y
xmake run test_http_stream -y
xmake run test_proxy -y
xmake run test_integration -y
xmake run test_types -y
xmake run test_serialization -y
xmake run test_coro -y
xmake run test_client -y
xmake run test_openai_serialize -y
xmake run test_anthropic_serialize -y
xmake run test_tool_calling -y
xmake run test_structured_output -y
xmake run test_embeddings -y
xmake run test_llmapi_integration -y
- name: Build with mcpp
run: mcpp build
8 changes: 2 additions & 6 deletions .xlings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"workspace": {
"cmake": "4.0.2",
"ninja": "1.12.1",
"xmake": "3.0.7",
"gcc": { "linux": "15.1.0" },
"llvm": { "macosx": "20.1.7" }
"mcpp": { "linux": "0.0.3" }
}
}
}
Loading