Skip to content

Commit 868279b

Browse files
committed
Fix bugs in testing-make.yml
* Make workflow much less eager * Check status rather than use continue-on-error, which suppresses failures * Install pybind11 on macOS
1 parent 997fb66 commit 868279b

4 files changed

Lines changed: 105 additions & 29 deletions

File tree

.github/workflows/testing-make.yml

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ on:
1010
- ".github/**"
1111
- "!.github/workflows/testing-make.yml"
1212

13+
- "CMakeLists.txt"
14+
- "CMakePresets.json"
15+
- "**.cmake"
16+
- "vcpkg.json"
17+
- "vcpkg-configuration.json"
18+
19+
- "doc/**"
20+
- "packaging/**"
21+
- "python_bindings/**"
22+
23+
- "pyproject.toml"
24+
- "uv.lock"
25+
26+
- "README.md"
27+
- "CODE_OF_CONDUCT.md"
28+
- "LICENSE.txt"
29+
- ".gitignore"
30+
- ".gitattributes"
31+
- ".gitmodules"
32+
- ".lldbinit"
33+
1334
concurrency:
1435
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1536
cancel-in-progress: true
@@ -30,47 +51,54 @@ jobs:
3051
steps:
3152
- uses: actions/checkout@v6
3253

54+
- uses: astral-sh/setup-uv@v5
55+
3356
- name: Install dependencies
3457
run: |
3558
if [ "$RUNNER_OS" = "Linux" ]; then
3659
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
37-
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${LLVM_VERSION} main" | sudo tee "/etc/apt/sources.list.d/llvm-${LLVM_VERSION}.list"
60+
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${LLVM_VERSION} main" | \
61+
sudo tee "/etc/apt/sources.list.d/llvm-${LLVM_VERSION}.list"
3862
sudo apt-get update
3963
sudo apt-get install -y \
40-
build-essential pkg-config libpng-dev libjpeg-turbo8-dev \
41-
"llvm-${LLVM_VERSION}-dev" "clang-${LLVM_VERSION}" "lld-${LLVM_VERSION}" "liblld-${LLVM_VERSION}-dev"
42-
elif [ "$RUNNER_OS" = "macOS" ]; then
43-
brew install "llvm@${LLVM_VERSION}" "lld@${LLVM_VERSION}" libjpeg-turbo libpng pkgconf protobuf
44-
fi
45-
46-
- name: Set up environment
47-
run: |
48-
if [ "$RUNNER_OS" = "Linux" ]; then
64+
build-essential \
65+
pkg-config \
66+
libpng-dev \
67+
libjpeg-turbo8-dev \
68+
"llvm-${LLVM_VERSION}-dev" \
69+
"clang-${LLVM_VERSION}" \
70+
"lld-${LLVM_VERSION}" \
71+
"liblld-${LLVM_VERSION}-dev"
4972
echo "LLVM_CONFIG=llvm-config-${LLVM_VERSION}" | tee -a "$GITHUB_ENV"
5073
elif [ "$RUNNER_OS" = "macOS" ]; then
74+
brew install libjpeg-turbo libpng pkgconf protobuf "llvm@${LLVM_VERSION}" "lld@${LLVM_VERSION}"
5175
echo "LLVM_CONFIG=$(brew --prefix "llvm@${LLVM_VERSION}")/bin/llvm-config" | tee -a "$GITHUB_ENV"
5276
fi
77+
78+
uv sync --group ci-base --no-install-project
79+
echo "${GITHUB_WORKSPACE}/.venv/bin" | tee -a "$GITHUB_PATH"
80+
echo "VIRTUAL_ENV=${GITHUB_WORKSPACE}/.venv" | tee -a "$GITHUB_ENV"
5381
echo "MAKEFLAGS=-j $(getconf _NPROCESSORS_ONLN)" | tee -a "$GITHUB_ENV"
5482
5583
- run: make build_tests
5684

5785
- run: make test_internal
58-
continue-on-error: true
86+
if: ${{ !cancelled() }}
5987

6088
- run: make test_correctness
61-
continue-on-error: true
89+
if: ${{ !cancelled() }}
6290

6391
- run: make test_generator
64-
continue-on-error: true
92+
if: ${{ !cancelled() }}
6593

6694
- run: make test_error
67-
continue-on-error: true
95+
if: ${{ !cancelled() }}
6896

6997
- run: make test_warning
70-
continue-on-error: true
98+
if: ${{ !cancelled() }}
7199

72100
- run: make test_apps
73-
continue-on-error: true
101+
if: ${{ !cancelled() }}
74102

75103
- run: make test_tutorial
76-
continue-on-error: true
104+
if: ${{ !cancelled() }}

apps/onnx/model.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ HalideModel convert_onnx_model(
2020
const std::unordered_map<std::string, int> &expected_dim_sizes,
2121
const IOLayout layout) {
2222
onnx::ModelProto onnx_model;
23-
onnx_model.ParseFromString(onnx_model_str);
23+
if (!onnx_model.ParseFromString(onnx_model_str)) {
24+
throw std::invalid_argument("Failed to parse the ONNX model");
25+
}
2426

2527
if (onnx_model.graph().output_size() == 0) {
2628
throw std::invalid_argument("No output specified in the model");

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ dev = [
7070
apps = [
7171
"onnx==1.18.0; platform_machine != 'armv8l' and platform_machine != 'armv7l'", # for apps/onnx
7272
"onnx==1.17.0; platform_machine == 'armv8l' or platform_machine == 'armv7l'", # for apps/onnx
73+
"protobuf>=7", # onnx 1.18.0 gencode requires protobuf 7.x runtime
7374
"pytest", # unspecified onnx dependency
7475
]
7576
tools = [

0 commit comments

Comments
 (0)