Skip to content

Commit aca829a

Browse files
committed
Add Rust to the CI suite
Signed-off-by: Scott Wilson <scott@propersquid.com>
1 parent 2325227 commit aca829a

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.github/workflows/build-steps.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ on:
6666
type: string
6767
nametag:
6868
type: string
69+
rust:
70+
type: string
6971
secrets:
7072
PASSED_GITHUB_TOKEN:
7173
required: false
@@ -149,6 +151,13 @@ jobs:
149151
if: inputs.clang_format == '1'
150152
shell: bash
151153
run: src/build-scripts/run-clang-format.bash
154+
- name: Rust Install Toolchain
155+
if: inputs.rust == '1'
156+
uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
157+
- name: Rust Test
158+
if: inputs.rust == '1'
159+
shell: bash
160+
run: src/build-scripts/ci-rust-test.bash
152161
- name: Code coverage
153162
if: inputs.coverage == '1'
154163
run: src/build-scripts/ci-coverage.bash

.github/workflows/ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ jobs:
274274
ctest_test_timeout: ${{ matrix.ctest_test_timeout }}
275275
coverage: ${{ matrix.coverage || 0 }}
276276
sonar: ${{ matrix.sonar || 0 }}
277+
rust: ${{ matrix.rust || 0 }}
277278
strategy:
278279
fail-fast: false
279280
matrix:
@@ -287,6 +288,7 @@ jobs:
287288
fmt_ver: 10.1.1
288289
pybind11_ver: v2.10.0
289290
setenvs: PUGIXML_VERSION=v1.13
291+
rust: 1
290292
- desc: VFX2023 icc/C++17 py3.10 exr3.1 ocio2.1 qt5.15
291293
nametag: linux-vfx2023.icc
292294
runner: ubuntu-latest
@@ -301,6 +303,7 @@ jobs:
301303
OIIO_EXTRA_CPP_ARGS="-fp-model=precise"
302304
FREETYPE_VERSION=VER-2-13-0
303305
DISABLE_libuhdr=1
306+
rust: 1
304307
# For icc, use fp-model precise to eliminate needless LSB errors
305308
# that make test results differ from other platforms.
306309
- desc: VFX2023 icx/C++17 py3.10 exr3.1 ocio2.2 qt5.15
@@ -316,6 +319,7 @@ jobs:
316319
xOPENCOLORIO_CXX=g++
317320
UHDR_CMAKE_C_COMPILER=gcc
318321
UHDR_CMAKE_CXX_COMPILER=g++
322+
rust: 1
319323
# Building libuhdr with icx results in test failures
320324
# so we force using gcc/g++.
321325
- desc: VFX2024 gcc11/C++17 py3.11 exr3.2 ocio2.3
@@ -327,6 +331,7 @@ jobs:
327331
fmt_ver: 10.1.1
328332
pybind11_ver: v2.12.0
329333
setenvs: PUGIXML_VERSION=v1.14
334+
rust: 1
330335
- desc: VFX2024 clang/C++17 py3.11 exr3.2 ocio2.3
331336
nametag: linux-vfx2024.clang
332337
runner: ubuntu-latest
@@ -338,6 +343,7 @@ jobs:
338343
fmt_ver: 10.1.1
339344
pybind11_ver: v2.12.0
340345
setenvs: PUGIXML_VERSION=v1.14
346+
rust: 1
341347
- desc: VFX2025 gcc11/C++17 py3.11 exr3.3 ocio2.4
342348
nametag: linux-vfx2025
343349
runner: ubuntu-latest
@@ -347,6 +353,7 @@ jobs:
347353
fmt_ver: 11.1.4
348354
pybind11_ver: v2.13.6
349355
setenvs: PUGIXML_VERSION=v1.15
356+
rust: 1
350357
- desc: Sanitizers
351358
nametag: sanitizer
352359
runner: ubuntu-latest
@@ -419,6 +426,7 @@ jobs:
419426
WEBP_VERSION=v1.5.0
420427
FREETYPE_VERSION=VER-2-13-3
421428
USE_OPENVDB=0
429+
rust: 1
422430
- desc: bleeding edge gcc14 C++20 py3.12 OCIO/libtiff/exr-main avx2
423431
nametag: linux-bleeding-edge
424432
runner: ubuntu-24.04
@@ -431,6 +439,7 @@ jobs:
431439
pybind11_ver: master
432440
python_ver: "3.12"
433441
simd: avx2,f16c
442+
rust: 1
434443
setenvs: export LIBJPEGTURBO_VERSION=main
435444
LIBRAW_VERSION=master
436445
LIBTIFF_VERSION=master
@@ -445,7 +454,7 @@ jobs:
445454
FREETYPE_VERSION=master
446455
QT_VERSION=0 INSTALL_OPENCV=0
447456
# The installed OpenVDB has a TLS conflict with Python 3.8
448-
# Disabling the `apt-get update` in gh-installdeps.bash
457+
# Disabling the `apt-get update` in gh-installdeps.bash
449458
# addresses a job killing problem in the GHA Ubuntu
450459
# 24.04 runners that cropped up circa May 29 2024. Maybe
451460
# it will be fixed and we can do the update again later?
@@ -464,6 +473,7 @@ jobs:
464473
PTEX_VERSION=v2.4.2
465474
PUGIXML_VERSION=v1.14
466475
WEBP_VERSION=v1.4.0
476+
rust: 1
467477

468478
- desc: clang15 C++17 avx2 exr3.1 ocio2.2
469479
nametag: linux-clang14
@@ -477,6 +487,7 @@ jobs:
477487
pybind11_ver: v2.12.0
478488
python_ver: "3.10"
479489
simd: avx2,f16c
490+
rust: 1
480491
- desc: debug gcc9/C++17, sse4.2, exr3.1
481492
nametag: linux-gcc9-cpp17-debug
482493
runner: ubuntu-22.04
@@ -489,6 +500,7 @@ jobs:
489500
pybind11_ver: v2.7.0
490501
ctest_test_timeout: 1200
491502
setenvs: export PUGIXML_VERSION=v1.9
503+
rust: 1
492504
- desc: static libs gcc9 C++17 exr3.1
493505
nametag: linux-static
494506
runner: ubuntu-22.04
@@ -501,6 +513,7 @@ jobs:
501513
depcmds: |
502514
sudo rm -rf /usr/local/include/OpenEXR
503515
sudo rm -rf /usr/local/lib64/cmake/{IlmBase,OpenEXR}
516+
rust: 1
504517

505518

506519
#
@@ -536,6 +549,7 @@ jobs:
536549
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
537550
coverage: ${{ matrix.coverage || 0 }}
538551
sonar: ${{ matrix.sonar || 0 }}
552+
rust: ${{ matrix.rust || 0 }}
539553
strategy:
540554
fail-fast: false
541555
matrix:
@@ -550,20 +564,23 @@ jobs:
550564
simd: sse4.2,avx2
551565
ctest_test_timeout: 1200
552566
setenvs: export MACOSX_DEPLOYMENT_TARGET=12.0
567+
rust: 1
553568
- desc: MacOS-14-ARM aclang15/C++20/py3.12
554569
runner: macos-14
555570
nametag: macos14-arm-py312
556571
cc_compiler: clang
557572
cxx_compiler: clang++
558573
cxx_std: 20
559574
python_ver: "3.12"
575+
rust: 1
560576
- desc: MacOS-15-ARM aclang16/C++20/py3.13
561577
runner: macos-15
562578
nametag: macos15-arm-py313
563579
cc_compiler: clang
564580
cxx_compiler: clang++
565581
cxx_std: 20
566582
python_ver: "3.13"
583+
rust: 1
567584

568585

569586
#
@@ -599,6 +616,7 @@ jobs:
599616
ctest_test_timeout: ${{ matrix.ctest_test_timeout }}
600617
coverage: ${{ matrix.coverage || 0 }}
601618
sonar: ${{ matrix.sonar || 0 }}
619+
rust: ${{ matrix.rust || 0 }}
602620
strategy:
603621
fail-fast: false
604622
matrix:
@@ -610,23 +628,27 @@ jobs:
610628
generator: "Visual Studio 16 2019"
611629
python_ver: "3.9"
612630
setenvs: export OPENIMAGEIO_PYTHON_LOAD_DLLS_FROM_PATH=1
631+
rust: 1
613632
- desc: Windows-2022 VS2022
614633
runner: windows-2022
615634
nametag: windows-2022
616635
vsver: 2022
617636
generator: "Visual Studio 17 2022"
618637
python_ver: "3.9"
619638
setenvs: export OPENIMAGEIO_PYTHON_LOAD_DLLS_FROM_PATH=1
639+
rust: 1
620640
- desc: Windows-2025 VS2022
621641
runner: windows-2025
622642
nametag: windows-2025
623643
vsver: 2022
624644
generator: "Visual Studio 17 2022"
625645
python_ver: "3.9"
626646
setenvs: export OPENIMAGEIO_PYTHON_LOAD_DLLS_FROM_PATH=1
647+
rust: 1
627648
- desc: Windows-2025 VS2022
628649
runner: windows-2025
629650
vsver: 2022
630651
generator: "Visual Studio 17 2022"
631652
python_ver: "3.9"
632653
setenvs: export OPENIMAGEIO_PYTHON_LOAD_DLLS_FROM_PATH=1
654+
rust: 1
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright Contributors to the OpenImageIO project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# https://github.com/AcademySoftwareFoundation/OpenImageIO
6+
7+
# Important: set -ex causes this whole script to terminate with error if
8+
# any command in it fails. This is crucial for CI tests.
9+
# (Though we let it run all the way through for code coverage workflows.)
10+
if [[ "${CODECOV}" == "" ]]; then
11+
set -ex
12+
fi
13+
14+
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib
15+
export PKG_CONFIG_PATH=$OpenImageIO_ROOT/lib/pkgconfig
16+
17+
echo "Running Rust oiio-sys tests"
18+
19+
pushd src/rust/oiio-sys
20+
time cargo test --all-features
21+
popd
22+
23+
echo "Running Rust oiio tests"
24+
25+
pushd src/rust
26+
time cargo test --all-features
27+
popd

0 commit comments

Comments
 (0)