Skip to content

Commit 6694e5d

Browse files
authored
Fix bugs in testing-make.yml (#8991)
* 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 * Drop Intel macOS testing for Make
1 parent 749b999 commit 6694e5d

4 files changed

Lines changed: 102 additions & 31 deletions

File tree

.github/workflows/testing-make.yml

Lines changed: 45 additions & 18 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
@@ -24,53 +45,59 @@ jobs:
2445
os:
2546
- ubuntu-24.04
2647
- macos-15
27-
- macos-15-intel
2848

2949
runs-on: ${{ matrix.os }}
3050
steps:
3151
- uses: actions/checkout@v6
3252

53+
- uses: astral-sh/setup-uv@v5
54+
3355
- name: Install dependencies
3456
run: |
3557
if [ "$RUNNER_OS" = "Linux" ]; then
3658
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"
59+
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${LLVM_VERSION} main" | \
60+
sudo tee "/etc/apt/sources.list.d/llvm-${LLVM_VERSION}.list"
3861
sudo apt-get update
3962
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
63+
build-essential \
64+
pkg-config \
65+
libpng-dev \
66+
libjpeg-turbo8-dev \
67+
"llvm-${LLVM_VERSION}-dev" \
68+
"clang-${LLVM_VERSION}" \
69+
"lld-${LLVM_VERSION}" \
70+
"liblld-${LLVM_VERSION}-dev"
4971
echo "LLVM_CONFIG=llvm-config-${LLVM_VERSION}" | tee -a "$GITHUB_ENV"
5072
elif [ "$RUNNER_OS" = "macOS" ]; then
73+
brew install libjpeg-turbo libpng pkgconf protobuf "llvm@${LLVM_VERSION}" "lld@${LLVM_VERSION}"
5174
echo "LLVM_CONFIG=$(brew --prefix "llvm@${LLVM_VERSION}")/bin/llvm-config" | tee -a "$GITHUB_ENV"
5275
fi
76+
77+
uv sync --group ci-base --no-install-project
78+
echo "${GITHUB_WORKSPACE}/.venv/bin" | tee -a "$GITHUB_PATH"
79+
echo "VIRTUAL_ENV=${GITHUB_WORKSPACE}/.venv" | tee -a "$GITHUB_ENV"
5380
echo "MAKEFLAGS=-j $(getconf _NPROCESSORS_ONLN)" | tee -a "$GITHUB_ENV"
5481
5582
- run: make build_tests
5683

5784
- run: make test_internal
58-
continue-on-error: true
85+
if: ${{ !cancelled() }}
5986

6087
- run: make test_correctness
61-
continue-on-error: true
88+
if: ${{ !cancelled() }}
6289

6390
- run: make test_generator
64-
continue-on-error: true
91+
if: ${{ !cancelled() }}
6592

6693
- run: make test_error
67-
continue-on-error: true
94+
if: ${{ !cancelled() }}
6895

6996
- run: make test_warning
70-
continue-on-error: true
97+
if: ${{ !cancelled() }}
7198

7299
- run: make test_apps
73-
continue-on-error: true
100+
if: ${{ !cancelled() }}
74101

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

apps/onnx/model.cpp

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

2628
if (onnx_model.graph().output_size() == 0) {
2729
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)