|
| 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 | + - uses: ./.github/actions/setup-toolchain |
| 66 | + - name: Build & Run (unix) |
| 67 | + if: runner.os != 'Windows' |
| 68 | + working-directory: tests |
| 69 | + run: | |
| 70 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 71 | + xmake f -P . -y |
| 72 | + xmake build -P . -y templates_test |
| 73 | + xmake run -P . templates_test |
| 74 | + - name: Build & Run (windows) |
| 75 | + if: runner.os == 'Windows' |
| 76 | + working-directory: tests |
| 77 | + run: | |
| 78 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 79 | + xmake f -P . -y |
| 80 | + xmake build -P . -y templates_test |
| 81 | + xmake run -P . templates_test |
| 82 | +
|
| 83 | + cmdline: |
| 84 | + needs: detect-changes |
| 85 | + if: needs.detect-changes.outputs.cmdline == 'true' |
| 86 | + strategy: |
| 87 | + fail-fast: false |
| 88 | + matrix: |
| 89 | + include: |
| 90 | + - { os: ubuntu-24.04, shell: bash } |
| 91 | + - { os: macos-15, shell: bash } |
| 92 | + - { os: windows-latest, shell: pwsh } |
| 93 | + runs-on: ${{ matrix.os }} |
| 94 | + name: cmdline (${{ matrix.os }}) |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + - uses: ./.github/actions/setup-toolchain |
| 98 | + - name: Build & Run (unix) |
| 99 | + if: runner.os != 'Windows' |
| 100 | + working-directory: tests |
| 101 | + run: | |
| 102 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 103 | + xmake f -P . -y |
| 104 | + xmake build -P . -y cmdline_test |
| 105 | + xmake run -P . cmdline_test test_input |
| 106 | + - name: Build & Run (windows) |
| 107 | + if: runner.os == 'Windows' |
| 108 | + working-directory: tests |
| 109 | + run: | |
| 110 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 111 | + xmake f -P . -y |
| 112 | + xmake build -P . -y cmdline_test |
| 113 | + xmake run -P . cmdline_test test_input |
| 114 | +
|
| 115 | + llmapi: |
| 116 | + needs: detect-changes |
| 117 | + if: needs.detect-changes.outputs.llmapi == 'true' |
| 118 | + strategy: |
| 119 | + fail-fast: false |
| 120 | + matrix: |
| 121 | + include: |
| 122 | + - { os: ubuntu-24.04, shell: bash } |
| 123 | + - { os: macos-15, shell: bash } |
| 124 | + - { os: windows-latest, shell: pwsh } |
| 125 | + runs-on: ${{ matrix.os }} |
| 126 | + name: llmapi (${{ matrix.os }}) |
| 127 | + steps: |
| 128 | + - uses: actions/checkout@v4 |
| 129 | + - uses: ./.github/actions/setup-toolchain |
| 130 | + - name: Build (unix) |
| 131 | + if: runner.os != 'Windows' |
| 132 | + working-directory: tests |
| 133 | + run: | |
| 134 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 135 | + xmake f -P . -y |
| 136 | + xmake build -P . -y llmapi_test |
| 137 | + xmake build -P . -y llmapi_test_c |
| 138 | + - name: Build (windows) |
| 139 | + if: runner.os == 'Windows' |
| 140 | + working-directory: tests |
| 141 | + run: | |
| 142 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 143 | + xmake f -P . -y |
| 144 | + xmake build -P . -y llmapi_test |
| 145 | + xmake build -P . -y llmapi_test_c |
| 146 | +
|
| 147 | + lua: |
| 148 | + needs: detect-changes |
| 149 | + if: needs.detect-changes.outputs.lua == 'true' |
| 150 | + strategy: |
| 151 | + fail-fast: false |
| 152 | + matrix: |
| 153 | + include: |
| 154 | + - { os: ubuntu-24.04, shell: bash } |
| 155 | + - { os: macos-15, shell: bash } |
| 156 | + - { os: windows-latest, shell: pwsh } |
| 157 | + runs-on: ${{ matrix.os }} |
| 158 | + name: lua (${{ matrix.os }}) |
| 159 | + steps: |
| 160 | + - uses: actions/checkout@v4 |
| 161 | + - uses: ./.github/actions/setup-toolchain |
| 162 | + - name: Build & Run (unix) |
| 163 | + if: runner.os != 'Windows' |
| 164 | + working-directory: tests |
| 165 | + run: | |
| 166 | + export PATH="$HOME/.xlings/subos/current/bin:$PATH" |
| 167 | + xmake f -P . -y |
| 168 | + xmake build -P . -y lua_test |
| 169 | + xmake run -P . lua_test |
| 170 | + - name: Build & Run (windows) |
| 171 | + if: runner.os == 'Windows' |
| 172 | + working-directory: tests |
| 173 | + run: | |
| 174 | + $env:PATH = "$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH" |
| 175 | + xmake f -P . -y |
| 176 | + xmake build -P . -y lua_test |
| 177 | + xmake run -P . lua_test |
0 commit comments