okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge main (87dfca0e7) into f-own-int: the 0.2.14 app branch, fixtures and CI fixes, the Qwen4-readiness tools, the shape-engine build scriptsffb3d9b31

main
7.6 KiB211 linesraw
1name: Checks
2
3# The fast checks (tools/check), one job per step so a failure names its step: the CPU CMake preset, the Python suites, the host's
4# typecheck / test / build.  No GPU, no model and no download of weights.  The config snapshot has its own workflow (snapshot.yml)
5# and the backend compile checks theirs (backends.yml).  Run the same thing by hand:  python tools/check --only <step>
6
7on:
8  push:
9    branches: [main]
10    paths:
11      - .github/workflows/check.yml
12      - tools/check
13      - requirements*.txt
14      - CMakeLists.txt
15      - CMakePresets.json
16      - cmake/**
17      - src/**
18      - include/**
19      - bench/micro/**
20      - third_party/**
21      - tests/**
22      - serve/**
23      - strata.py
24      - setup.py
25      - strata_cli/**
26      - strata_control/**
27      - tools/**
28      - packaging/**
29      - docker/**
30      - apps/host/**
31      - apps/desktop/**
32      - metal/**
33      - sycl/**
34  pull_request:
35    paths:
36      - .github/workflows/check.yml
37      - tools/check
38      - requirements*.txt
39      - CMakeLists.txt
40      - CMakePresets.json
41      - cmake/**
42      - src/**
43      - include/**
44      - bench/micro/**
45      - third_party/**
46      - tests/**
47      - serve/**
48      - strata.py
49      - setup.py
50      - strata_cli/**
51      - strata_control/**
52      - tools/**
53      - packaging/**
54      - docker/**
55      - apps/host/**
56      - apps/desktop/**
57      - metal/**
58      - sycl/**
59  workflow_dispatch:
60
61permissions:
62  contents: read
63
64concurrency:
65  group: checks-${{ github.ref }}
66  cancel-in-progress: true
67
68jobs:
69  linux:
70    name: Linux / ${{ matrix.name }}
71    runs-on: ubuntu-24.04
72    timeout-minutes: 90
73    strategy:
74      fail-fast: false
75      matrix:
76        include:
77          - { name: cpu CMake preset, only: cmake-cpu }
78          - { name: Python tests/, only: py-tests }
79          - { name: Python serve/, only: py-serve }
80          - { name: Python tools/, only: py-tools }
81          - { name: host typecheck + test + build, only: "host-typecheck,host-test,host-build" }
82    steps:
83      - uses: actions/checkout@v4
84        with:
85          persist-credentials: false
86      - uses: actions/setup-python@v5
87        with:
88          python-version: '3.12'
89          cache: pip
90          cache-dependency-path: requirements*.txt
91      - uses: actions/setup-node@v4
92        if: ${{ startsWith(matrix.only, 'host') }}
93        with:
94          node-version: '24'
95          cache: npm
96          cache-dependency-path: apps/host/package-lock.json
97      - name: Python packages
98        run: python -m pip install -r requirements.txt -r requirements-dev.txt -r requirements-build.txt
99      - name: tools/check
100        run: python tools/check --only "${{ matrix.only }}" --keep --scratch "$RUNNER_TEMP/check" --json "$RUNNER_TEMP/check/result.json"
101      - name: Logs
102        if: ${{ failure() }}
103        uses: actions/upload-artifact@v4
104        with:
105          name: check-linux-${{ strategy.job-index }}
106          path: |
107            ${{ runner.temp }}/check/*.log
108            ${{ runner.temp }}/check/result.json
109          retention-days: 7
110
111  windows:
112    name: Windows / ${{ matrix.name }}
113    runs-on: windows-2022
114    timeout-minutes: 120
115    strategy:
116      fail-fast: false
117      matrix:
118        include:
119          - { name: cpu CMake preset (MSVC), only: cmake-cpu }
120          - { name: Python tests/, only: py-tests }
121          - { name: Python serve/, only: py-serve }
122          - { name: Python tools/, only: py-tools }
123          - { name: host typecheck + test + build, only: "host-typecheck,host-test,host-build" }
124    steps:
125      - uses: actions/checkout@v4
126        with:
127          persist-credentials: false
128      - uses: actions/setup-python@v5
129        with:
130          python-version: '3.12'
131          cache: pip
132          cache-dependency-path: requirements*.txt
133      - uses: actions/setup-node@v4
134        if: ${{ startsWith(matrix.only, 'host') }}
135        with:
136          node-version: '24'
137          cache: npm
138          cache-dependency-path: apps/host/package-lock.json
139      - name: Python packages
140        run: python -m pip install -r requirements.txt -r requirements-dev.txt -r requirements-build.txt
141      # Diagnostic, not a check: what a Windows PowerShell 5.1 child returns when its parent runs under PowerShell 7 (a user who starts
142      # the app or `strata` from a PowerShell 7 window). The tests drop PowerShell 7's PSModulePath entries; the product does not yet.
143      - name: PowerShell 7 parent (diagnostic)
144        if: ${{ startsWith(matrix.only, 'host') }}
145        continue-on-error: true
146        shell: pwsh
147        env:
148          STRATA_HOME: ${{ runner.temp }}\ps7-probe
149        run: |
150          "PSModulePath: $env:PSModulePath"
151          "--- powershell.exe Get-CimInstance | Select-Object (as hardware.mjs)"
152          powershell.exe -NoProfile -NonInteractive -Command "Get-CimInstance Win32_VideoController | Select-Object Name,PNPDeviceID | ConvertTo-Json -Compress"
153          "exit $LASTEXITCODE"
154          "--- the host's hardware probe (apps/host/server/hardware.mjs detect)"
155          node -e "import('./apps/host/server/hardware.mjs').then(m => m.detect({ force: true })).then(h => console.log(JSON.stringify({ cpu: h.cpu, gpus: h.gpus })), e => console.log('ERROR', e && e.stack))"
156          "--- setup.py cpu_info (powershell Get-CimInstance Win32_Processor)"
157          python -c "import setup; print(repr(setup.cpu_info()))"
158      # tools/check finds Visual Studio's compiler itself (vcvars64.bat); bash is Git for Windows' (the tester-README tests need it)
159      - name: tools/check
160        run: python tools/check --only "${{ matrix.only }}" --keep --scratch "$env:RUNNER_TEMP\check" --json "$env:RUNNER_TEMP\check\result.json"
161      - name: Logs
162        if: ${{ failure() }}
163        uses: actions/upload-artifact@v4
164        with:
165          name: check-windows-${{ strategy.job-index }}
166          path: |
167            ${{ runner.temp }}\check\*.log
168            ${{ runner.temp }}\check\result.json
169          retention-days: 7
170
171  macos:
172    # Cheap and useful (the audit found the host and Python fixtures reading the Mac's own paths), but this job has not run on a
173    # Mac runner yet: it reports and does not block until its first green run.
174    name: macOS / ${{ matrix.name }}
175    runs-on: macos-15
176    timeout-minutes: 60
177    continue-on-error: true
178    strategy:
179      fail-fast: false
180      matrix:
181        include:
182          - { name: Python tools/, only: py-tools }
183          - { name: host typecheck + test + build, only: "host-typecheck,host-test,host-build" }
184    steps:
185      - uses: actions/checkout@v4
186        with:
187          persist-credentials: false
188      - uses: actions/setup-python@v5
189        with:
190          python-version: '3.12'
191          cache: pip
192          cache-dependency-path: requirements*.txt
193      - uses: actions/setup-node@v4
194        if: ${{ startsWith(matrix.only, 'host') }}
195        with:
196          node-version: '24'
197          cache: npm
198          cache-dependency-path: apps/host/package-lock.json
199      - name: Python packages
200        run: python -m pip install -r requirements.txt -r requirements-dev.txt
201      - name: tools/check
202        run: python tools/check --only "${{ matrix.only }}" --keep --scratch "$RUNNER_TEMP/check" --json "$RUNNER_TEMP/check/result.json"
203      - name: Logs
204        if: ${{ failure() }}
205        uses: actions/upload-artifact@v4
206        with:
207          name: check-macos-${{ strategy.job-index }}
208          path: |
209            ${{ runner.temp }}/check/*.log
210            ${{ runner.temp }}/check/result.json
211          retention-days: 7