Skip to content

add multi-platform CI and mcpplibs-index-add skill #4

add multi-platform CI and mcpplibs-index-add skill

add multi-platform CI and mcpplibs-index-add skill #4

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths:
- 'packages/**'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
branches: [main]
paths:
- 'packages/**'
- 'tests/**'
- '.github/workflows/ci.yml'
env:
XLINGS_NON_INTERACTIVE: 1
jobs:
detect-changes:
runs-on: ubuntu-24.04
outputs:
templates: ${{ steps.filter.outputs.templates }}
cmdline: ${{ steps.filter.outputs.cmdline }}
llmapi: ${{ steps.filter.outputs.llmapi }}
lua: ${{ steps.filter.outputs.lua }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
templates:
- 'packages/t/templates/**'
- 'tests/t/templates/**'
- '.github/workflows/ci.yml'
cmdline:
- 'packages/c/cmdline/**'
- 'tests/c/cmdline/**'
- '.github/workflows/ci.yml'
llmapi:
- 'packages/l/llmapi/**'
- 'tests/l/llmapi/**'
- '.github/workflows/ci.yml'
lua:
- 'packages/m/mcpplibs-capi-lua/**'
- 'tests/l/lua/**'
- '.github/workflows/ci.yml'
templates:
needs: detect-changes
if: needs.detect-changes.outputs.templates == 'true'
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, shell: bash }
- { os: macos-15, shell: bash }
- { os: windows-latest, shell: pwsh }
runs-on: ${{ matrix.os }}
name: templates (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Setup (unix)
if: runner.os != 'Windows'
run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash
- name: Setup (windows)
if: runner.os == 'Windows'
run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex
- name: Install toolchain (linux)
if: runner.os == 'Linux'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install gcc@15 -y
- name: Install toolchain (macos)
if: runner.os == 'macOS'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install llvm@20 -y
- name: Build & Run (linux)
if: runner.os == 'Linux'
working-directory: tests/t/templates
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y templates_test
xmake run templates_test
- name: Build & Run (macos)
if: runner.os == 'macOS'
working-directory: tests/t/templates
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y templates_test
xmake run templates_test
- name: Build & Run (windows)
if: runner.os == 'Windows'
working-directory: tests/t/templates
run: |
$env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
xmake f -y
xmake build -y templates_test
xmake run templates_test
cmdline:
needs: detect-changes
if: needs.detect-changes.outputs.cmdline == 'true'
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, shell: bash }
- { os: macos-15, shell: bash }
- { os: windows-latest, shell: pwsh }
runs-on: ${{ matrix.os }}
name: cmdline (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Setup (unix)
if: runner.os != 'Windows'
run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash
- name: Setup (windows)
if: runner.os == 'Windows'
run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex
- name: Install toolchain (linux)
if: runner.os == 'Linux'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install gcc@15 -y
- name: Install toolchain (macos)
if: runner.os == 'macOS'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install llvm@20 -y
- name: Build & Run (linux)
if: runner.os == 'Linux'
working-directory: tests/c/cmdline
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y cmdline_test
xmake run cmdline_test test_input
- name: Build & Run (macos)
if: runner.os == 'macOS'
working-directory: tests/c/cmdline
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y cmdline_test
xmake run cmdline_test test_input
- name: Build & Run (windows)
if: runner.os == 'Windows'
working-directory: tests/c/cmdline
run: |
$env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
xmake f -y
xmake build -y cmdline_test
xmake run cmdline_test test_input
llmapi:
needs: detect-changes
if: needs.detect-changes.outputs.llmapi == 'true'
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, shell: bash }
- { os: macos-15, shell: bash }
- { os: windows-latest, shell: pwsh }
runs-on: ${{ matrix.os }}
name: llmapi (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Setup (unix)
if: runner.os != 'Windows'
run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash
- name: Setup (windows)
if: runner.os == 'Windows'
run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex
- name: Install toolchain (linux)
if: runner.os == 'Linux'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install gcc@15 -y
- name: Install toolchain (macos)
if: runner.os == 'macOS'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install llvm@20 -y
- name: Build llmapi (linux)
if: runner.os == 'Linux'
working-directory: tests/l/llmapi
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y llmapi_test
- name: Build llmapi (macos)
if: runner.os == 'macOS'
working-directory: tests/l/llmapi
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y llmapi_test
- name: Build llmapi (windows)
if: runner.os == 'Windows'
working-directory: tests/l/llmapi
run: |
$env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
xmake f -y
xmake build -y llmapi_test
- name: Build llmapi-capi (linux)
if: runner.os == 'Linux'
working-directory: tests/l/llmapi/capi
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y llmapi_test_c
- name: Build llmapi-capi (macos)
if: runner.os == 'macOS'
working-directory: tests/l/llmapi/capi
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y llmapi_test_c
- name: Build llmapi-capi (windows)
if: runner.os == 'Windows'
working-directory: tests/l/llmapi/capi
run: |
$env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
xmake f -y
xmake build -y llmapi_test_c
lua:
needs: detect-changes
if: needs.detect-changes.outputs.lua == 'true'
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, shell: bash }
- { os: macos-15, shell: bash }
- { os: windows-latest, shell: pwsh }
runs-on: ${{ matrix.os }}
name: lua (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Setup (unix)
if: runner.os != 'Windows'
run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash
- name: Setup (windows)
if: runner.os == 'Windows'
run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex
- name: Install toolchain (linux)
if: runner.os == 'Linux'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install gcc@15 -y
- name: Install toolchain (macos)
if: runner.os == 'macOS'
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xlings install llvm@20 -y
- name: Build & Run (linux)
if: runner.os == 'Linux'
working-directory: tests/l/lua
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y lua_test
xmake run lua_test
- name: Build & Run (macos)
if: runner.os == 'macOS'
working-directory: tests/l/lua
run: |
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
xmake f -y
xmake build -y lua_test
xmake run lua_test
- name: Build & Run (windows)
if: runner.os == 'Windows'
working-directory: tests/l/lua
run: |
$env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
xmake f -y
xmake build -y lua_test
xmake run lua_test