From 8417f8eb048ec62eece02ee910323a3bcdd43275 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Tue, 27 Sep 2022 11:24:39 -0700 Subject: [PATCH] CI: Move clang-format test to main section (#1588) Signed-off-by: Larry Gritz --- .github/workflows/ci.yml | 57 +++++++++++---------------------- src/build-scripts/ci-build.bash | 5 +-- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cee66d35d..28ef45777 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,6 +196,25 @@ jobs: # texture system adequately and is able to ignore the benign # "leaks." + # Test formatting. This test entry doesn't do a full build, it + # just runs clang-format on everything, and passes if nothing is + # misformatted. Upon failure, the build artifact will be the full + # source code with the formatting fixed (diffs will also appear in + # the console output). + - desc: "clang-format" + nametag: clang-format + os: ubuntu-latest + vfxyear: 2022 + vfxsuffix: -clang14 + cxx_std: 17 + openimageio_ver: release + python_ver: 3.9 + simd: avx2,f16c + batched: b8_AVX2 + skip_tests: 1 + setenvs: export BUILDTARGET=clang-format + OPENIMAGEIO_CMAKE_FLAGS=-DUSE_PYTHON=0 + runs-on: ${{matrix.os}} container: image: aswftesting/ci-osl:${{matrix.vfxyear}}${{matrix.vfxsuffix}} @@ -462,41 +481,3 @@ jobs: build/*.cmake build/CMake* build/testsuite/*/*.* - - - clang-format: - # Test formatting. This test entry doesn't do a full build, it just runs - # clang-format on everything, and passes if nothing is misformatted. - # Upon failure, the build artifact will be the full source code with the - # formatting fixed (diffs will also appear in the console output). - name: "clang-format verification" - runs-on: ubuntu-20.04 - container: - image: aswf/ci-osl:2022-clang14 - env: - BUILDTARGET: clang-format - CMAKE_CXX_STANDARD: 17 - PYTHON_VERSION: 3.9 - steps: - # We would like to use harden-runner, but it flags too many false - # positives, every time we download a dependency. We should use it only - # on CI runs where we are producing artifacts that users might rely on. - # - name: Harden Runner - # uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # v1.4.3 - # with: - # egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - name: Build setup - run: | - src/build-scripts/ci-startup.bash - - name: Dependencies - run: | - src/build-scripts/gh-installdeps.bash - - name: Build - run: | - src/build-scripts/ci-build.bash - - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 - if: failure() - with: - name: osl-${{github.job}} - path: src/*/*.{cpp,h} diff --git a/src/build-scripts/ci-build.bash b/src/build-scripts/ci-build.bash index ebabd7ec1..41530d03f 100755 --- a/src/build-scripts/ci-build.bash +++ b/src/build-scripts/ci-build.bash @@ -32,9 +32,10 @@ cmake .. -G "$CMAKE_GENERATOR" \ mkdir cmake-save || /bin/true cp -r CMake* *.cmake cmake-save +: ${BUILDTARGET:=install} if [[ "$BUILDTARGET" != "none" ]] ; then - echo "Parallel build " ${CMAKE_BUILD_PARALLEL_LEVEL} - time ${OSL_CMAKE_BUILD_WRAPPER} cmake --build . --target ${BUILDTARGET:=install} --config ${CMAKE_BUILD_TYPE} + echo "Parallel build ${CMAKE_BUILD_PARALLEL_LEVEL} of target ${BUILDTARGET}" + time ${OSL_CMAKE_BUILD_WRAPPER} cmake --build . --target ${BUILDTARGET} --config ${CMAKE_BUILD_TYPE} fi popd