Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 45 additions & 17 deletions .github/workflows/testing-make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ on:
- ".github/**"
- "!.github/workflows/testing-make.yml"

- "CMakeLists.txt"
- "CMakePresets.json"
- "**.cmake"
- "vcpkg.json"
- "vcpkg-configuration.json"

- "doc/**"
- "packaging/**"
- "python_bindings/**"

- "pyproject.toml"
- "uv.lock"

- "README.md"
- "CODE_OF_CONDUCT.md"
- "LICENSE.txt"
- ".gitignore"
- ".gitattributes"
- ".gitmodules"
- ".lldbinit"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -30,47 +51,54 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
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"
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"
sudo apt-get update
sudo apt-get install -y \
build-essential pkg-config libpng-dev libjpeg-turbo8-dev \
"llvm-${LLVM_VERSION}-dev" "clang-${LLVM_VERSION}" "lld-${LLVM_VERSION}" "liblld-${LLVM_VERSION}-dev"
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install "llvm@${LLVM_VERSION}" "lld@${LLVM_VERSION}" libjpeg-turbo libpng pkgconf protobuf
fi

- name: Set up environment
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
build-essential \
pkg-config \
libpng-dev \
libjpeg-turbo8-dev \
"llvm-${LLVM_VERSION}-dev" \
"clang-${LLVM_VERSION}" \
"lld-${LLVM_VERSION}" \
"liblld-${LLVM_VERSION}-dev"
echo "LLVM_CONFIG=llvm-config-${LLVM_VERSION}" | tee -a "$GITHUB_ENV"
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install libjpeg-turbo libpng pkgconf protobuf "llvm@${LLVM_VERSION}" "lld@${LLVM_VERSION}"
echo "LLVM_CONFIG=$(brew --prefix "llvm@${LLVM_VERSION}")/bin/llvm-config" | tee -a "$GITHUB_ENV"
fi

uv sync --group ci-base --no-install-project
echo "${GITHUB_WORKSPACE}/.venv/bin" | tee -a "$GITHUB_PATH"
echo "VIRTUAL_ENV=${GITHUB_WORKSPACE}/.venv" | tee -a "$GITHUB_ENV"
echo "MAKEFLAGS=-j $(getconf _NPROCESSORS_ONLN)" | tee -a "$GITHUB_ENV"

- run: make build_tests

- run: make test_internal
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_correctness
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_generator
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_error
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_warning
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_apps
continue-on-error: true
if: ${{ !cancelled() }}

- run: make test_tutorial
continue-on-error: true
if: ${{ !cancelled() }}
4 changes: 3 additions & 1 deletion apps/onnx/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ HalideModel convert_onnx_model(
const std::unordered_map<std::string, int> &expected_dim_sizes,
const IOLayout layout) {
onnx::ModelProto onnx_model;
onnx_model.ParseFromString(onnx_model_str);
if (!onnx_model.ParseFromString(onnx_model_str)) {
throw std::invalid_argument("Failed to parse the ONNX model");
}

if (onnx_model.graph().output_size() == 0) {
throw std::invalid_argument("No output specified in the model");
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dev = [
apps = [
"onnx==1.18.0; platform_machine != 'armv8l' and platform_machine != 'armv7l'", # for apps/onnx
"onnx==1.17.0; platform_machine == 'armv8l' or platform_machine == 'armv7l'", # for apps/onnx
"protobuf>=7", # onnx 1.18.0 gencode requires protobuf 7.x runtime
"pytest", # unspecified onnx dependency
]
tools = [
Expand Down
Loading
Loading