Run formatting check in GA CI using clang-format
@@ -10,6 +10,18 @@ on:
jobs:
+ # Check code formatting correctness
+ # -----------------------------------------------------------------------------------------------
+ formatting-check:
+ name: Formatting Check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Run clang-format style check
+ uses: jidicula/clang-format-action@v4.5.0
+ with:
+ clang-format-version: '13'
+
# Run unittests on modern-ish versions of gcc and clang.
# -----------------------------------------------------------------------------------------------
unittest:
@@ -49,7 +61,7 @@ jobs:
# Build ubuntu package, release artifact and update "latest" release if necessary.
# -----------------------------------------------------------------------------------------------
build_ubuntu:
- needs: unittest
+ needs: [unittest, formatting-check]
name: Build ubuntu-latest
runs-on: ubuntu-latest
@@ -103,7 +115,7 @@ jobs:
# Build macos package, release artifact and update "latest" release if necessary.
# -----------------------------------------------------------------------------------------------
build_macos:
- needs: unittest
+ needs: [unittest, formatting-check]
name: Build macos-11
runs-on: macos-11
@@ -141,7 +153,7 @@ jobs:
# Build windows package, release artifact and update "latest" release if necessary.
# -----------------------------------------------------------------------------------------------
build_windows:
- needs: unittest
+ needs: [unittest, formatting-check]
name: Build windows-amd64
runs-on: ubuntu-latest
