-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (92 loc) · 4.2 KB
/
Copy pathtest.yml
File metadata and controls
100 lines (92 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: tests
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
# Runs on x86 AND Arm64 on purpose. coldpath analyses Arm binaries; it does not need to
# run on Arm. Most people's CI is x86, so that path has to work.
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -e ".[dev]"
- run: python -m pytest -q
# Regression for the P0: scanning a PE inside an archive used to crash on Windows because
# pefile kept the file mapped and the temp-dir teardown failed (WinError 32). Runs on every OS;
# only Windows actually exercised the lock, so this leg is the guard.
- name: Scan a PE-in-archive (must not crash)
shell: bash
run: |
curl -sL -o o.zip "https://github.com/ollama/ollama/releases/download/v0.31.2/ollama-windows-arm64.zip"
python -m coldpath o.zip
# Prove the CI-gate Action actually works: it must PASS a warm binary and FAIL a cold one.
action-selftest:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Fetch one warm and one cold binary
run: |
LV=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | python3 -c "import sys,json;print(json.load(sys.stdin)['tag_name'])")
curl -sL -o l.tgz "https://github.com/ggml-org/llama.cpp/releases/download/$LV/llama-$LV-bin-ubuntu-arm64.tar.gz"
mkdir _w && tar xzf l.tgz -C _w && cp _w/*/libggml-cpu-armv8.6_1.so warm.so
curl -sL -o o.zip "https://github.com/ollama/ollama/releases/download/v0.31.2/ollama-windows-arm64.zip"
mkdir _c && unzip -q o.zip -d _c && cp _c/lib/ollama/ggml-cpu.dll cold.dll
- name: Action must PASS on a warm binary
uses: ./
with:
path: warm.so
require: i8mm
- name: Action must FAIL on a cold binary
id: coldgate
continue-on-error: true
uses: ./
with:
path: cold.dll
require: i8mm
- name: Assert the gate failed the cold binary
run: |
test "${{ steps.coldgate.outcome }}" = "failure" \
&& echo "CI gate correctly failed the cold binary" \
|| { echo "Action did NOT fail on a cold binary"; exit 1; }
# The claim in the README must survive contact with the real binaries, on every push.
verify-findings:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -e ".[dev]"
- name: llama.cpp official linux-arm64 -- the ISA ladder must reproduce
run: |
V=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | python -c "import sys,json;print(json.load(sys.stdin)['tag_name'])")
curl -sL -o l.tgz "https://github.com/ggml-org/llama.cpp/releases/download/$V/llama-$V-bin-ubuntu-arm64.tar.gz"
mkdir -p lcpp && tar xzf l.tgz -C lcpp
python scripts/verify_ladder.py lcpp
- name: Ollama official windows-arm64 -- must still be a cold path
run: |
V=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | python -c "import sys,json;print(json.load(sys.stdin)['tag_name'])")
curl -sL -o o.zip "https://github.com/ollama/ollama/releases/download/$V/ollama-windows-arm64.zip"
mkdir -p oll && unzip -q o.zip -d oll
coldpath oll/lib/ollama/ggml-cpu.dll
# If Ollama ever fixes this, THIS STEP FAILS -- and that is the good outcome.
# A green build here means the bug is still shipping.
if coldpath --require dotprod --quiet oll/lib/ollama/ggml-cpu.dll; then
echo "::notice::Ollama's Windows-on-Arm build now has matrix kernels. The finding is fixed."
exit 1
else
echo "::warning::Ollama windows-arm64 still ships zero matrix instructions."
fi