add multi-platform CI and mcpplibs-index-add skill #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: | |
| - name: templates | |
| dir: tests/t/templates | |
| target: templates_test | |
| run: true | |
| - name: cmdline | |
| dir: tests/c/cmdline | |
| target: cmdline_test | |
| run: true | |
| run_args: test_input | |
| - name: llmapi | |
| dir: tests/l/llmapi | |
| target: llmapi_test | |
| run: false | |
| - name: llmapi-capi | |
| dir: tests/l/llmapi/capi | |
| target: llmapi_test_c | |
| run: false | |
| - name: lua | |
| dir: tests/l/lua | |
| target: lua_test | |
| run: true | |
| platform: | |
| - os: ubuntu-24.04 | |
| setup: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-14 g++-14 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
| toolchain: gcc | |
| - os: macos-15 | |
| setup: brew install llvm@20 | |
| toolchain: llvm | |
| sdk: /opt/homebrew/opt/llvm@20 | |
| runs-on: ${{ matrix.platform.os }} | |
| name: ${{ matrix.test.name }} (${{ matrix.platform.os }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup xmake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| - name: Setup toolchain | |
| run: ${{ matrix.platform.setup }} | |
| - name: Configure | |
| working-directory: ${{ matrix.test.dir }} | |
| run: | | |
| if [ -n "${{ matrix.platform.sdk }}" ]; then | |
| xmake f -y --toolchain=${{ matrix.platform.toolchain }} --sdk=${{ matrix.platform.sdk }} | |
| else | |
| xmake f -y --toolchain=${{ matrix.platform.toolchain }} | |
| fi | |
| - name: Build | |
| working-directory: ${{ matrix.test.dir }} | |
| run: xmake build ${{ matrix.test.target }} | |
| - name: Run | |
| if: matrix.test.run | |
| working-directory: ${{ matrix.test.dir }} | |
| run: xmake run ${{ matrix.test.target }} ${{ matrix.test.run_args }} |