From c7d8eabcc67b99b8b0e69726ed09f9b2717ed674 Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Mon, 26 Dec 2022 15:18:53 -0800 Subject: [PATCH] Add Clang Format step This changelist adds a Clang Format step to GitHub Actions builds, uploading the formatted source for developer reference. --- .github/workflows/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c917aff7b..65012e3f33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,6 +59,7 @@ jobs: compiler_version: "14" python: 3.9 cmake_config: -DMATERIALX_DYNAMIC_ANALYSIS=ON + clang_format: ON dynamic_analysis: ON - name: MacOS_Xcode_11_Python37 @@ -171,6 +172,10 @@ jobs: with: node-version: '16' + - name: Run Clang Format + if: matrix.clang_format == 'ON' + run: find source \( -name *.h -o -name *.cpp \) ! -path "*/Catch/*" ! -path "*/External/*" ! -path "*/NanoGUI/*" ! -path "*/PugiXML/*" ! -path "*/PyBind11/*" | xargs clang-format -i --verbose + - name: CMake Generate run: | mkdir build @@ -243,6 +248,13 @@ jobs: name: MaterialX_${{ matrix.name }} path: build/installed/ + - name: Upload Formatted Source + if: matrix.clang_format == 'ON' + uses: actions/upload-artifact@v3 + with: + name: MaterialX_ClangFormat + path: source + - name: Upload Reference Shaders uses: actions/upload-artifact@v3 if: matrix.upload_shaders == 'ON'