diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..819c5e0 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,37 @@ +name: verify + +on: + push: + branches: [main] + pull_request: + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/setup-node@v4 + with: + node-version: "20" + - name: collector parses + run: python3 -m py_compile collector/*.py + - name: collector suite + run: python3 -m unittest discover -s collector -p "test_*.py" + - name: ui primitives and ripple state machine + run: node smoke/ui-primitives.mjs + - name: app shell and view model + run: node smoke/shell.mjs + + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: collector suite (Win32 ctypes backend runs here) + shell: bash + run: python3 -m unittest discover -s collector -p "test_*.py" diff --git a/collector/hostinfo.py b/collector/hostinfo.py index 26321e4..2f9ffa3 100755 --- a/collector/hostinfo.py +++ b/collector/hostinfo.py @@ -180,7 +180,7 @@ def _win_cpu_times(): if _kernel32.GetSystemTimes(ctypes.byref(idle), ctypes.byref(kernel), ctypes.byref(user)): - total = (user.quad + kernel.quad, idle.quad) + total = (user.value + kernel.value, idle.value) return total, _win_cpu_cores() def _win_cpu_cores(): @@ -233,8 +233,8 @@ def _win_processes(): found = [] pids_buf = ctypes.create_string_buffer(65536) # 16384 PIDs needed = wintypes.DWORD(0) - if not _kernel32.EnumProcesses(pids_buf, ctypes.sizeof(pids_buf), - ctypes.byref(needed)): + if not _psapi.EnumProcesses(pids_buf, ctypes.sizeof(pids_buf), + ctypes.byref(needed)): return found n = needed.value // 4 pids = struct.unpack_from("%dI" % n, pids_buf.raw)