|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - 'packages/**' |
| 8 | + - 'tests/**' |
| 9 | + - '.github/workflows/ci.yml' |
| 10 | + pull_request: |
| 11 | + branches: [main] |
| 12 | + paths: |
| 13 | + - 'packages/**' |
| 14 | + - 'tests/**' |
| 15 | + - '.github/workflows/ci.yml' |
| 16 | + |
| 17 | +env: |
| 18 | + XLINGS_NON_INTERACTIVE: 1 |
| 19 | + |
| 20 | +jobs: |
| 21 | + detect-changes: |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + outputs: |
| 24 | + templates: ${{ steps.filter.outputs.templates }} |
| 25 | + cmdline: ${{ steps.filter.outputs.cmdline }} |
| 26 | + llmapi: ${{ steps.filter.outputs.llmapi }} |
| 27 | + lua: ${{ steps.filter.outputs.lua }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: dorny/paths-filter@v3 |
| 31 | + id: filter |
| 32 | + with: |
| 33 | + filters: | |
| 34 | + templates: |
| 35 | + - 'packages/t/templates/**' |
| 36 | + - 'tests/t/templates/**' |
| 37 | + - '.github/workflows/ci.yml' |
| 38 | + cmdline: |
| 39 | + - 'packages/c/cmdline/**' |
| 40 | + - 'tests/c/cmdline/**' |
| 41 | + - '.github/workflows/ci.yml' |
| 42 | + llmapi: |
| 43 | + - 'packages/l/llmapi/**' |
| 44 | + - 'tests/l/llmapi/**' |
| 45 | + - '.github/workflows/ci.yml' |
| 46 | + lua: |
| 47 | + - 'packages/m/mcpplibs-capi-lua/**' |
| 48 | + - 'tests/l/lua/**' |
| 49 | + - '.github/workflows/ci.yml' |
| 50 | +
|
| 51 | + templates: |
| 52 | + needs: detect-changes |
| 53 | + if: needs.detect-changes.outputs.templates == 'true' |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + include: |
| 58 | + - { os: ubuntu-24.04, shell: bash } |
| 59 | + - { os: macos-15, shell: bash } |
| 60 | + - { os: windows-latest, shell: pwsh } |
| 61 | + runs-on: ${{ matrix.os }} |
| 62 | + name: templates (${{ matrix.os }}) |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v4 |
| 65 | + - name: Setup (unix) |
| 66 | + if: runner.os != 'Windows' |
| 67 | + run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash |
| 68 | + - name: Setup (windows) |
| 69 | + if: runner.os == 'Windows' |
| 70 | + run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex |
| 71 | + - name: Install toolchain (linux) |
| 72 | + if: runner.os == 'Linux' |
| 73 | + run: | |
| 74 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 75 | + xlings install gcc@15 -y |
| 76 | + - name: Install toolchain (macos) |
| 77 | + if: runner.os == 'macOS' |
| 78 | + run: | |
| 79 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 80 | + xlings install llvm@20 -y |
| 81 | + - name: Build & Run (linux) |
| 82 | + if: runner.os == 'Linux' |
| 83 | + working-directory: tests/t/templates |
| 84 | + run: | |
| 85 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 86 | + xmake f -P . -y |
| 87 | + xmake build -P . -y templates_test |
| 88 | + xmake run -P . templates_test |
| 89 | + - name: Build & Run (macos) |
| 90 | + if: runner.os == 'macOS' |
| 91 | + working-directory: tests/t/templates |
| 92 | + run: | |
| 93 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 94 | + xmake f -P . -y |
| 95 | + xmake build -P . -y templates_test |
| 96 | + xmake run -P . templates_test |
| 97 | + - name: Build & Run (windows) |
| 98 | + if: runner.os == 'Windows' |
| 99 | + working-directory: tests/t/templates |
| 100 | + run: | |
| 101 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 102 | + xmake f -P . -y |
| 103 | + xmake build -P . -y templates_test |
| 104 | + xmake run -P . templates_test |
| 105 | +
|
| 106 | + cmdline: |
| 107 | + needs: detect-changes |
| 108 | + if: needs.detect-changes.outputs.cmdline == 'true' |
| 109 | + strategy: |
| 110 | + fail-fast: false |
| 111 | + matrix: |
| 112 | + include: |
| 113 | + - { os: ubuntu-24.04, shell: bash } |
| 114 | + - { os: macos-15, shell: bash } |
| 115 | + - { os: windows-latest, shell: pwsh } |
| 116 | + runs-on: ${{ matrix.os }} |
| 117 | + name: cmdline (${{ matrix.os }}) |
| 118 | + steps: |
| 119 | + - uses: actions/checkout@v4 |
| 120 | + - name: Setup (unix) |
| 121 | + if: runner.os != 'Windows' |
| 122 | + run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash |
| 123 | + - name: Setup (windows) |
| 124 | + if: runner.os == 'Windows' |
| 125 | + run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex |
| 126 | + - name: Install toolchain (linux) |
| 127 | + if: runner.os == 'Linux' |
| 128 | + run: | |
| 129 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 130 | + xlings install gcc@15 -y |
| 131 | + - name: Install toolchain (macos) |
| 132 | + if: runner.os == 'macOS' |
| 133 | + run: | |
| 134 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 135 | + xlings install llvm@20 -y |
| 136 | + - name: Build & Run (linux) |
| 137 | + if: runner.os == 'Linux' |
| 138 | + working-directory: tests/c/cmdline |
| 139 | + run: | |
| 140 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 141 | + xmake f -P . -y |
| 142 | + xmake build -P . -y cmdline_test |
| 143 | + xmake run -P . cmdline_test test_input |
| 144 | + - name: Build & Run (macos) |
| 145 | + if: runner.os == 'macOS' |
| 146 | + working-directory: tests/c/cmdline |
| 147 | + run: | |
| 148 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 149 | + xmake f -P . -y |
| 150 | + xmake build -P . -y cmdline_test |
| 151 | + xmake run -P . cmdline_test test_input |
| 152 | + - name: Build & Run (windows) |
| 153 | + if: runner.os == 'Windows' |
| 154 | + working-directory: tests/c/cmdline |
| 155 | + run: | |
| 156 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 157 | + xmake f -P . -y |
| 158 | + xmake build -P . -y cmdline_test |
| 159 | + xmake run -P . cmdline_test test_input |
| 160 | +
|
| 161 | + llmapi: |
| 162 | + needs: detect-changes |
| 163 | + if: needs.detect-changes.outputs.llmapi == 'true' |
| 164 | + strategy: |
| 165 | + fail-fast: false |
| 166 | + matrix: |
| 167 | + include: |
| 168 | + - { os: ubuntu-24.04, shell: bash } |
| 169 | + - { os: macos-15, shell: bash } |
| 170 | + - { os: windows-latest, shell: pwsh } |
| 171 | + runs-on: ${{ matrix.os }} |
| 172 | + name: llmapi (${{ matrix.os }}) |
| 173 | + steps: |
| 174 | + - uses: actions/checkout@v4 |
| 175 | + - name: Setup (unix) |
| 176 | + if: runner.os != 'Windows' |
| 177 | + run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash |
| 178 | + - name: Setup (windows) |
| 179 | + if: runner.os == 'Windows' |
| 180 | + run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex |
| 181 | + - name: Install toolchain (linux) |
| 182 | + if: runner.os == 'Linux' |
| 183 | + run: | |
| 184 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 185 | + xlings install gcc@15 -y |
| 186 | + - name: Install toolchain (macos) |
| 187 | + if: runner.os == 'macOS' |
| 188 | + run: | |
| 189 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 190 | + xlings install llvm@20 -y |
| 191 | + - name: Build llmapi (linux) |
| 192 | + if: runner.os == 'Linux' |
| 193 | + working-directory: tests/l/llmapi |
| 194 | + run: | |
| 195 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 196 | + xmake f -P . -y |
| 197 | + xmake build -P . -y llmapi_test |
| 198 | + - name: Build llmapi (macos) |
| 199 | + if: runner.os == 'macOS' |
| 200 | + working-directory: tests/l/llmapi |
| 201 | + run: | |
| 202 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 203 | + xmake f -P . -y |
| 204 | + xmake build -P . -y llmapi_test |
| 205 | + - name: Build llmapi (windows) |
| 206 | + if: runner.os == 'Windows' |
| 207 | + working-directory: tests/l/llmapi |
| 208 | + run: | |
| 209 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 210 | + xmake f -P . -y |
| 211 | + xmake build -P . -y llmapi_test |
| 212 | + - name: Build llmapi-capi (linux) |
| 213 | + if: runner.os == 'Linux' |
| 214 | + working-directory: tests/l/llmapi/capi |
| 215 | + run: | |
| 216 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 217 | + xmake f -P . -y |
| 218 | + xmake build -P . -y llmapi_test_c |
| 219 | + - name: Build llmapi-capi (macos) |
| 220 | + if: runner.os == 'macOS' |
| 221 | + working-directory: tests/l/llmapi/capi |
| 222 | + run: | |
| 223 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 224 | + xmake f -P . -y |
| 225 | + xmake build -P . -y llmapi_test_c |
| 226 | + - name: Build llmapi-capi (windows) |
| 227 | + if: runner.os == 'Windows' |
| 228 | + working-directory: tests/l/llmapi/capi |
| 229 | + run: | |
| 230 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 231 | + xmake f -P . -y |
| 232 | + xmake build -P . -y llmapi_test_c |
| 233 | +
|
| 234 | + lua: |
| 235 | + needs: detect-changes |
| 236 | + if: needs.detect-changes.outputs.lua == 'true' |
| 237 | + strategy: |
| 238 | + fail-fast: false |
| 239 | + matrix: |
| 240 | + include: |
| 241 | + - { os: ubuntu-24.04, shell: bash } |
| 242 | + - { os: macos-15, shell: bash } |
| 243 | + - { os: windows-latest, shell: pwsh } |
| 244 | + runs-on: ${{ matrix.os }} |
| 245 | + name: lua (${{ matrix.os }}) |
| 246 | + steps: |
| 247 | + - uses: actions/checkout@v4 |
| 248 | + - name: Setup (unix) |
| 249 | + if: runner.os != 'Windows' |
| 250 | + run: curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash |
| 251 | + - name: Setup (windows) |
| 252 | + if: runner.os == 'Windows' |
| 253 | + run: irm https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.ps1 | iex |
| 254 | + - name: Install toolchain (linux) |
| 255 | + if: runner.os == 'Linux' |
| 256 | + run: | |
| 257 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 258 | + xlings install gcc@15 -y |
| 259 | + - name: Install toolchain (macos) |
| 260 | + if: runner.os == 'macOS' |
| 261 | + run: | |
| 262 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 263 | + xlings install llvm@20 -y |
| 264 | + - name: Build & Run (linux) |
| 265 | + if: runner.os == 'Linux' |
| 266 | + working-directory: tests/l/lua |
| 267 | + run: | |
| 268 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 269 | + xmake f -P . -y |
| 270 | + xmake build -P . -y lua_test |
| 271 | + xmake run -P . lua_test |
| 272 | + - name: Build & Run (macos) |
| 273 | + if: runner.os == 'macOS' |
| 274 | + working-directory: tests/l/lua |
| 275 | + run: | |
| 276 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 277 | + xmake f -P . -y |
| 278 | + xmake build -P . -y lua_test |
| 279 | + xmake run -P . lua_test |
| 280 | + - name: Build & Run (windows) |
| 281 | + if: runner.os == 'Windows' |
| 282 | + working-directory: tests/l/lua |
| 283 | + run: | |
| 284 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 285 | + xmake f -P . -y |
| 286 | + xmake build -P . -y lua_test |
| 287 | + xmake run -P . lua_test |
0 commit comments